rm
rm: remove files and directories.
Synopsis
rm [-r] [-f] path…
Description
rm removes each file named. A symbolic link is removed itself, never what it points to. A directory is removed only with -r.
Options
Options may be combined (-rf) and may come anywhere among the paths.
- -r -R
- Remove directories and everything in them. Links inside are removed, never followed.
- -f
- Say nothing about paths that do not exist.
Exit status
0 if everything named was removed (or, with -f, was not there); 1 otherwise, or for an unknown option.
Notes
Any other option letter is refused (status 1, nothing removed). Any word starting with - is taken as options, so a file whose name starts with - must be named as ./-name. There is no -i (no prompting).
See also
rmdir(1), mv(1), find(1)