BSD 4_3_Reno release
[unix-history] / usr / src / bin / rmdir / rmdir.1
index 4407d31..4d01bb3 100644 (file)
@@ -1,66 +1,72 @@
-.\" Copyright (c) 1983 Regents of the University of California.
-.\" All rights reserved.  The Berkeley software License Agreement
-.\" specifies the terms and conditions for redistribution.
+.\" Copyright (c) 1990 The Regents of the University of California.
+.\" All rights reserved.
 .\"
 .\"
-.\"    @(#)rmdir.1     6.1 (Berkeley) %G%
+.\" Redistribution and use in source and binary forms are permitted provided
+.\" that: (1) source distributions retain this entire copyright notice and
+.\" comment, and (2) distributions including binaries display the following
+.\" acknowledgement:  ``This product includes software developed by the
+.\" University of California, Berkeley and its contributors'' in the
+.\" documentation or other materials provided with the distribution and in
+.\" all advertising materials mentioning features or use of this software.
+.\" Neither the name of the University nor the names of its contributors may
+.\" be used to endorse or promote products derived from this software without
+.\" specific prior written permission.
+.\" THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED
+.\" WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
+.\" MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
 .\"
 .\"
-.TH RMDIR 1 ""
-.UC 5
-.SH NAME
-rmdir, rm  \- remove (unlink) directories or files
-.SH SYNOPSIS
-.B rmdir
-dir ...
-.PP
-.B rm
-[
-.B \-f
-] [
-.B \-r
-] [
-.B \-i
-] [
-.B \-
-] file ...
-.PP
-.SH DESCRIPTION
-.PP
-.I Rmdir
-removes entries for the named directories, which must be empty.
-.PP
-.I Rm
-removes the entries for one or more files from a directory.
-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 the file itself.
-.PP
-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
-(force) option is given.
-.PP
-If a designated file is a directory,
-an error comment is printed unless the optional argument
-.B \-r
-has been used.  In that case,
-.I rm
-recursively deletes the entire contents of the specified directory,
-and the directory itself.
-.PP
-If the
-.B \-i
-(interactive) option is in effect,
-.I rm
-asks whether to delete each file, and, under
-.BR \-r ,
-whether to examine each directory.
-.PP
-The null option
-.B \-
-indicates that all the arguments following it are to be treated as
-file names.  This allows the specification of file names starting with
-a minus.
-.SH "SEE ALSO"
-rm(1), unlink(2), rmdir(2)
+.\"     @(#)rmdir.1    6.3 (Berkeley) 7/24/90
+.\"
+.Dd July 24, 1990
+.Dt RMDIR 1
+.Os BSD 4.4
+.Sh NAME
+.Nm rmdir
+.Nd remove directories
+.Sh SYNOPSIS
+.Nm rmdir
+.Op Fl p
+.Ar directory ...
+.Sh DESCRIPTION
+The rmdir utility removes the directory entry specified by
+each
+.Ar directory
+argument, provided it is empty.
+.Pp
+Arguments are processed in the order given.
+In order to remove both a parent directory and a subdirectory
+of that parent, the subdirectory
+must be specified first so the parent directory
+is empty when
+.Nm rmdir
+tries to remove it.
+.\" .Pp
+.\" The following option is available:
+.\" .Tw Ds
+.\" .Tp Fl p
+.\" Each
+.\" .Ar directory
+.\" argument is treated as a pathname of which all
+.\" components will be removed, if they are empty,
+.\" starting with the last most component.
+.\" (See
+.\" .Xr rm 1
+.\" for fully non-discriminant recursive removal).
+.Pp
+The
+.Nm rmdir
+utility exits with one of the following values:
+.Tw Ds
+.Tp Li \&0
+Each directory entry specified by a dir operand
+referred to an empty directory and was removed
+successfully.
+.Tp Li \&>\&0
+An error occurred.
+.Tp
+.Sh SEE ALSO
+.Xr rm 1
+.Sh STANDARDS
+The
+.Nm rmdir
+function is expected to be POSIX 1003.2 compatible.