--- layout: page category-page: fs category-title: FileSystem tags: directory list remove delete erase author: Mattia Hijman title: rm ---

The rm command is used to delete and unlink directories and files.
It attempts to remove the non-directory type files specified on the command line. If the permissions of the file do not permit writing, the user is prompted for confirmation.
It stands for ReMove.

rm [-dfiPRrvW] file1 file2 file....

Flags

Removing links

The rm utility removes symbolic links, not the files referenced by the links.
It is not allowed to remove the files "." or "..".
When the utility is called as unlink, only one argument, which must not be a directory, may be supplied. No options may be supplied in this simple mode of operation, which performs an unlink(2) operation on the passed argument.
The rm utility exits 0 if all of the named files or file hierarchies were removed, or if the -f option was specified and all of the existing files or file hierarchies were removed. If an error occurs, rm exits with a value 0.