unmap (user) address space early enough to allow sleep (if releasing
[unix-history] / usr / src / bin / rm / rm.1
CommitLineData
b5dc1377
CL
1.\" Copyright (c) 1990 The Regents of the University of California.
2.\" All rights reserved.
d1ca8f44 3.\"
b5dc1377 4.\" %sccs.include.redist.man%
d1ca8f44 5.\"
d0719240 6.\" @(#)rm.1 6.7 (Berkeley) %G%
b5dc1377 7.\"
a22de7e6 8.Vx
b5dc1377
CL
9.Dd
10.Dt RM 1
a22de7e6 11.Os
b5dc1377
CL
12.Sh NAME
13.Nm rm
14.Nd remove directory entries
15.Sh SYNOPSIS
16.Nm rm
17.Op Fl f Li \&| Fl i
7f9ef9cc 18.Op Fl dRr
b5dc1377
CL
19.Ar file ...
20.Sh DESCRIPTION
7f9ef9cc
KB
21The
22.Nm rm
23utility attempts to remove the non-directory type files specified on the
24command line.
25If the permissions of the file do not permit writing, and the standard
307d7749
KB
26input device is a terminal, the user is prompted (on the standard error
27output) for confirmation.
b5dc1377 28.Pp
307d7749 29The options are as follows:
5325ced3 30.Tw 8n
7f9ef9cc
KB
31.Tp Fl d
32Attempt to remove directories as well as other types of files.
b5dc1377 33.Tp Fl f
7f9ef9cc
KB
34Attempt to remove the files without prompting for confirmation,
35regardless of the file's permissions.
36If the file does not exist, do not display a diagnostic message or modify
37the exit status to reflect an error.
38The
39.Fl f
40option overrides any previous
41.Fl i
42options.
b5dc1377 43.Tp Fl i
7f9ef9cc
KB
44Request confirmation before attempting to remove each file, regardless of
45the file's permissions, or whether or not the standard input device is a
46terminal.
47The
48.Fl i
49option overrides any previous
50.Fl f
51options.
b5dc1377 52.Tp Fl R
7f9ef9cc
KB
53Attempt to remove the file hierarchy rooted in each file argument.
54The
55.Fl R
56option implies the
57.Fl d
58option.
59If the
60.Fl i
61option is specified, the user is prompted for confirmation before
62each directory's contents are processed (as well as before the attempt
63is made to remove the directory).
64If the user does not respond affirmatively, the file hierarchy rooted in
65that directory is skipped.
b5dc1377
CL
66.Pp
67.Tp Fl r
68Equivalent to
5325ced3 69.Fl R .
b5dc1377
CL
70.Tp
71.Pp
b5dc1377
CL
72The
73.Nm rm
7f9ef9cc
KB
74utility removes symbolic links, not the files referenced by the links.
75.Pp
76It is an error to attempt to remove the files ``.'' and ``..''.
77.Pp
78The
79.Nm rm
307d7749
KB
80utility exits 0 if all of the named files or file hierarchies were removed,
81or if the
7f9ef9cc 82.Fl f
307d7749
KB
83option was specified and all of the existing files or file hierarchies were
84removed.
85If an error occurs,
86.Nm rm
87exits with a value >0.
b5dc1377 88.Sh SEE ALSO
7f9ef9cc 89.Xr rmdir 1 ,
7f9ef9cc
KB
90.Xr unlink 2 ,
91.Xr fts 3
307d7749
KB
92.Sh COMPATIBILITY
93The
94.Nm rm
95utility differs from historical implementations in that the
96.Fl f
97option only masks attempts to remove non-existent files instead of
98masking a large variety of errors.
99.Pp
100Also, historical BSD implementations prompted on the standard output,
101not the standard error output.
b5dc1377
CL
102.Sh STANDARDS
103The
104.Nm rm
105function is expected to be POSIX 1003.2 compatible.