Jump to content

rm

From RaySoft

rm, short for remove, is a shell command for removing files (which includes special files such as directories) from the file system. The command may not actually delete a file (release its storage for reuse) since it only unlinks it – removes a hard link to a file via the unlink() system call. If a file has multiple links and less than all are removed, then the file remains in the file system; accessible via its other links. When a file's only link is removed, then the file is deleted – releasing its storage space for other use.[1]

Documentation

Syntax

rm [PARAMETER ...] [FILE/DIRECTORY ...]

Parameters

General
The following parameters can be used with all version of rm:
NOTE:
The BSD version only supports the short form (e.g. -f) of these parameters!
-f, --force
Ignore nonexistent files, never prompt.
-r, -R, --recursive
Remove directories and their contents recursively.
-v, --verbose
Explain what is being done.
GNU
The following parameters can be used with the GNU version of rm:
-d, --dir
Remove empty directories.

References

  1. Wikipedia contributors. "rm (Unix)." Wikipedia. https://en.wikipedia.org/wiki/Rm_(Unix) (accessed 19.08.2025)