BSD 4_2 development
[unix-history] / usr / man / man1 / rm.1
CommitLineData
9f66c60a
C
1.TH RM 1 "1 April 1981"
2.UC 4
3.SH NAME
4rm, rmdir \- remove (unlink) files or directories
5.SH SYNOPSIS
6.B rm
7[
8.B \-f
9] [
10.B \-r
11] [
12.B \-i
13] [
14.B \-
15] file ...
16.PP
17.B rmdir
18dir ...
19.PP
20.SH DESCRIPTION
21.I Rm
22removes the entries for one or more files from a directory.
23If an entry was the last link to the file, the file is destroyed.
24Removal of a file requires write permission in its directory,
25but neither read nor write permission on the file itself.
26.PP
27If a file has no write permission and the standard input is a terminal,
28its permissions are printed and a line is read from the standard input.
29If that line begins with `y' the file is deleted, otherwise the file remains.
30No questions are asked and no errors are reported when 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 argument
36.B \-r
37has been used. In that case,
38.I rm
39recursively deletes the entire contents of the specified directory,
40and the directory itself.
41.PP
42If the
43.B \-i
44(interactive) option is in effect,
45.I rm
46asks whether to delete each file, and, under
47.BR \-r ,
48whether to examine each directory.
49.PP
50The null option
51.B \-
52indicates that all the arguments following it are to be treated as
53file names. This allows the specification of file names starting with
54a minus.
55.PP
56.I Rmdir
57removes entries for the named directories, which must be empty.
58.SH "SEE ALSO"
59rm(1), unlink(2), rmdir(2)