Linux Command Directory
This directory of Linux commands is from Linux in a Nutshell, 5th Edition.
Click on any of the 687 commands below to get a description and list of available options. All links in the command summaries point to the online version of the book on Safari Bookshelf.
rm [options] files
Delete one or more files. To remove a file, you must have write permission in the directory that contains the file, but you need not have permission on the file itself. If you do not have write permission on the file, you will be prompted (y or n) to override. rm is often aliased to rm -i, especially for the root user, to protect against inadvertently deleting files.
Remove directories, even if they are not empty. Available only to a privileged user.
Remove write-protected files without prompting.
Print a help message and then exit.
Prompt for y (remove the file) or n (do not remove the file).
Do not treat root (/) specially. This is the default.
Do not operate recursively on root (/).
If file is a directory, remove the entire directory and all its contents, including subdirectories. Be forewarned: use of this option can be dangerous.
Verbose mode (print the name of each file before removing it).
Print version information and then exit.
Mark the end of options. Use this when you need to supply a filename beginning with -.