rmdir

remove directory

Command


SYNOPSIS

rmdir [-p] directory...


DESCRIPTION

The rmdir command removes each requested directory. Each directory must be empty for rmdir to be successful.

Options

-p

removes all intermediate components. For example,

rmdir -p abc/def/ghi
is equivalent to
rmdir abc/def/ghi
rmdir abc/def
rmdir abc


DIAGNOSTICS

Possible exit status values are:
0

Successful completion.

1

Failure because directory is not a directory, or because it still contains files or subdirectories.

2

Failure because of an invalid command line option, or no directory names specified.

Non-empty directory

means that files or other directories are found under the directory to be removed. Use rm -r to remove the directory.

No such directory

means that the requested directory does not exist or is otherwise inaccessible.

Current directory illegal

indicates that you should use cd to change to another directory before removing the current directory.


PORTABILITY

POSIX.2. x/OPEN Portability Guide 4.0.


SEE ALSO

Commands:
mkdir, rm


Updated 11/15/2022 MKS Toolkit [3khat16.ico]HP3000 [3khat16.ico]3kMail [archive16.gif]