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