RM(1) UNIX Programmer's Manual RM(1)
rm, rmdir - remove (unlink) files or directories
S
\bSY
\bYN
\bNO
\bOP
\bPS
\bSI
\bIS
\bS
r
\brm
\bm [ -
\b-f
\bf ] [ -
\b-r
\br ] [ -
\b-i
\bi ] [ -
\b- ] file ...
r
\brm
\bmd
\bdi
\bir
\br dir ...
D
\bDE
\bES
\bSC
\bCR
\bRI
\bIP
\bPT
\bTI
\bIO
\bON
\bN
_
\bR_
\bm removes the entries for one or more files from a direc-
tory. 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
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. No questions
are asked and no errors are reported when the -
\b-f
\bf (force)
If a designated file is a directory, an error comment is
printed unless the optional argument -
\b-r
\br has been used. In
that case, _
\br_
\bm recursively deletes the entire contents of the
specified directory, and the directory itself.
If the -
\b-i
\bi (interactive) option is in effect, _
\br_
\bm asks whether
to delete each file, and, under -
\b-r
\br, whether to examine each
The null option -
\b- indicates that all the arguments following
it are to be treated as file names. This allows the specif-
ication of file names starting with a minus.
_
\bR_
\bm_
\bd_
\bi_
\br removes entries for the named directories, which must
S
\bSE
\bEE
\bE A
\bAL
\bLS
\bSO
\bO
rm(1), unlink(2), rmdir(2)
Printed 7/9/88 April 29, 1985 1