date and time created 88/10/18 21:20:25 by bostic
[unix-history] / usr / src / bin / rmdir / rmdir.1
CommitLineData
78652bce
KM
1.\" Copyright (c) 1983 Regents of the University of California.
2.\" All rights reserved. The Berkeley software License Agreement
3.\" specifies the terms and conditions for redistribution.
4.\"
35705f59 5.\" @(#)rmdir.1 6.1 (Berkeley) %G%
78652bce 6.\"
35705f59 7.TH RMDIR 1 ""
78652bce
KM
8.UC 5
9.SH NAME
10rmdir, rm \- remove (unlink) directories or files
11.SH SYNOPSIS
12.B rmdir
13dir ...
14.PP
15.B rm
16[
17.B \-f
18] [
19.B \-r
20] [
21.B \-i
22] [
23.B \-
24] file ...
25.PP
26.SH DESCRIPTION
27.PP
28.I Rmdir
29removes entries for the named directories, which must be empty.
30.PP
31.I Rm
32removes the entries for one or more files from a directory.
33If an entry was the last link to the file, the file is destroyed.
34Removal of a file requires write permission in its directory,
35but neither read nor write permission on the file itself.
36.PP
37If a file has no write permission and the standard input is a terminal,
38its permissions are printed and a line is read from the standard input.
39If that line begins with `y' the file is deleted, otherwise the file remains.
40No questions are asked and no errors are reported when the
41.B \-f
42(force) option is given.
43.PP
44If a designated file is a directory,
45an error comment is printed unless the optional argument
46.B \-r
47has been used. In that case,
48.I rm
49recursively deletes the entire contents of the specified directory,
50and the directory itself.
51.PP
52If the
53.B \-i
54(interactive) option is in effect,
55.I rm
56asks whether to delete each file, and, under
57.BR \-r ,
58whether to examine each directory.
59.PP
60The null option
61.B \-
62indicates that all the arguments following it are to be treated as
63file names. This allows the specification of file names starting with
64a minus.
65.SH "SEE ALSO"
66rm(1), unlink(2), rmdir(2)