RM(1) — Unix Programmer’s Manual
NAME
rm, rmdir − remove (unlink) files or directories
SYNOPSIS
rm [ options ] file ...
rmdir dir ...
DESCRIPTION
Rm removes the entries for one or more files from a directory. If an entry was the last link to the file, the file is destroyed. Removal of a file requires write permission in its directory, but neither read nor write permission on the file itself.
If a file has no write permission and the standard input is a terminal, its permissions are printed and a line is read from the standard input. If that line begins with ‘y’ the file is deleted, otherwise the file remains.
Rmdir removes entries for the named directories, which must be empty. Rmdir does not understand any of the options accepted by rm.
OPTIONS
− Indicates that all the arguments following it are to be treated as filenames. This allows the specification of filenames starting with a minus. (− is called the null option.)
−f Forces rm not to ask questions and not to report errors.
−i Asks whether to delete each file, and, under −r, whether to examine each directory. (The "i" stands for interactive.)
Recursively deletes the entire contents of the specified directory
and the directory itself. Without this option, rm prints an error message when asked to delete a directory.
SEE ALSO
rm(1), rmdir(1), unlink(2), rmdir(2)
4th Berkeley Distribution — April 29, 1985