Removing files and directories within CentOS can be done with the rm
command.
Below is the “files” directory which contains several files. We will delete the “file2” file.
To delete “file2”, type rm file2
in the terminal.
As you can see above, the file “file2” was successfully deleted.
The “rm” command is universal across all Linux systems and will work with popular distros such as Ubuntu, Debian, etc.