From Wikipedia, the free encyclopedia.
The rm command in the Unix operating system is used to remove files from the file system. It is similar to the del command in MS-DOS.
Its usage is considered potentially more dangerous than equivalents in other operating systems because of the way Unix and Unix-like systems parse wildcards and names of special directories and in its non-verbose actions. A classic example:
$ rm * .o rm: cannot remove `.o': No such file or directory
Options
; -d, --directory : unlink FILE, even if it is a non-empty directory (super-user only) ; -f, --force : ignore nonexistent files, never prompt ; -i, --interactive : prompt before any removal ; -r, -R, --recursive : remove the contents of directories recursively ; -v, --verbose : explain what is being done ; --help : display help and exit ; --version : output version information and exitTo remove a file whose name starts with a `-', for example `-foo', use one of these commands:
rm -- -fooNote that if you use rm to remove a file, it is usually possible to recover the contents of that file. If you want more assurance that the contents are truly unrecoverable, consider using shred.rm ./-foo

