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