Research V7 development
[unix-history] / usr / man / man1 / rm.1
CommitLineData
5203c864
KT
1.TH RM 1
2.SH NAME
3rm, rmdir \- remove (unlink) files
4.SH SYNOPSIS
5.B rm
6[
7.B \-fri
8] file ...
9.PP
10.B rmdir
11dir ...
12.PP
13.SH DESCRIPTION
14.I Rm
15removes the entries for one or more
16files
17from a directory.
18If an entry was the last link to the file, the file
19is destroyed.
20Removal of a file requires write permission in its directory,
21but neither read nor write permission on the file itself.
22.PP
23If a file has no write permission
24and the standard input is a terminal,
25its permissions are printed and a line is read from
26the standard input.
27If that line begins with `y' the file is deleted,
28otherwise the file remains.
29No questions are asked
30when the
31.B \-f
32(force) option is given.
33.PP
34If a designated file is a directory,
35an error comment is printed unless the optional
36argument
37.B \-r
38has been used.
39In that case,
40.I rm
41recursively deletes the
42entire contents of the specified directory,
43and the directory itself.
44.PP
45If the
46.B \-i
47(interactive) option is in effect,
48.I rm
49asks whether to delete each file,
50and, under
51.BR \-r ,
52whether to examine each directory.
53.PP
54.I Rmdir
55removes entries for the named directories,
56which must be empty.
57.SH "SEE ALSO"
58unlink(2)
59.SH DIAGNOSTICS
60Generally self-explanatory.
61It is forbidden to remove the file `..' merely to avoid the
62antisocial consequences of inadvertently doing something like
63`rm \-r .*'.