How to Remove Files and Directories in CentOS

How to Remove Files and Directories in CentOS

By: ZebraHost

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.

image

To delete “file2”, type rm file2 in the terminal.

image

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.