rm [ options ] file ...
removes the named file
arguments. By default it does not remove directories. If a file is unwritable, the standard
input is a terminal, and the --force
option is not given, rm
prompts the user for whether to remove the file. An
affirmative response (y
) removes the file, a quit response (q
) causes rm
immediately, and all other responses skip the current file.
- -c|F, --clear|clobber
Clear the contents of each file before removing by writing a 0 filled buffer the same
size as the file, executing fsync(2) and closing before attempting to remove.
Implemented only on systems that support fsync(2).
- -d, --directory
unlink(2)) directories rather than
rmdir(2), and don't require that they be empty before removal. The caller
requires sufficient privilege, not to mention a strong constitution, to use this option. Even though the directory must not be
empty, rm still attempts to empty it before removal.
- -f, --force
Ignore nonexistent files, ignore no file operands specified, and never prompt the user.
- -i, --interactive|prompt
Prompt whether to remove each file. An affirmative response (y or Y)
removes the file, a quit response (q or Q) causes rm to exit immediately, and all other responses skip the
- -r|R, --recursive
Remove the contents of directories recursively.
- -u, --unconditional
If --recursive and --force are also enabled then the owner read, write and
execute modes are enabled (if not already enabled) for each directory before attempting to remove directory contents.
- -v, --verbose
Print the name of each file before removing it.