xref: /original-bsd/bin/rmdir/rmdir.1 (revision e61fc7ea)
1.\" Copyright (c) 1990 The Regents of the University of California.
2.\" All rights reserved.
3.\"
4.\" %sccs.include.redist.man%
5.\"
6.\"     @(#)rmdir.1	6.3 (Berkeley) 07/24/90
7.\"
8.Dd
9.Dt RMDIR 1
10.Os BSD 4.4
11.Sh NAME
12.Nm rmdir
13.Nd remove directories
14.Sh SYNOPSIS
15.Nm rmdir
16.Op Fl p
17.Ar directory ...
18.Sh DESCRIPTION
19The rmdir utility removes the directory entry specified by
20each
21.Ar directory
22argument, provided it is empty.
23.Pp
24Arguments are processed in the order given.
25In order to remove both a parent directory and a subdirectory
26of that parent, the subdirectory
27must be specified first so the parent directory
28is empty when
29.Nm rmdir
30tries to remove it.
31.\" .Pp
32.\" The following option is available:
33.\" .Tw Ds
34.\" .Tp Fl p
35.\" Each
36.\" .Ar directory
37.\" argument is treated as a pathname of which all
38.\" components will be removed, if they are empty,
39.\" starting with the last most component.
40.\" (See
41.\" .Xr rm 1
42.\" for fully non-discriminant recursive removal).
43.Pp
44The
45.Nm rmdir
46utility exits with one of the following values:
47.Tw Ds
48.Tp Li \&0
49Each directory entry specified by a dir operand
50referred to an empty directory and was removed
51successfully.
52.Tp Li \&>\&0
53An error occurred.
54.Tp
55.Sh SEE ALSO
56.Xr rm 1
57.Sh STANDARDS
58The
59.Nm rmdir
60function is expected to be POSIX 1003.2 compatible.
61