RMDIR(1) General Commands Manual Fully-rendered PDF

rmdirremove directory

rmdir [-pve] directory

Removes directoryies, and, with -p, their parents.

, --parents
Remove parents of each directory, up to the first failure.
, --verbose
Write which directories were removed to the standard output stream.
, --ignore-fail-on-non-empty
Don't error if removal failed with ENOTEMPTY.

if a directory (or its parent with -p) couldn't be removed, except if -e and because ENOTEMPTY.

mkdir(1), rm(1), rmdir(2)

Conforms to IEEE Std 1003.1-2024 (“POSIX.1”). -v and --ignore-fail-on-non-empty are extensions, also present on the GNU system.

Short -e is an extension, compatible with the KornShell.

-v is also available in FreeBSD 6.0.

Appears in the first edition of the UNIX Programmer's Manual as rmdir(I):

Version 7 AT&T UNIX merges that page into rm(1) with an updated SYNOPSIS of

rmdir dir ...
As rm now forks out to rmdir to remove directories in -r mode. This is standardised in X/Open Portability Guide Issue 2 (“XPG2”).

4.2BSD and AT&T System V Release 3 UNIX add rmdir(2), reducing both implementations considerably. AT&T System V Release 3 UNIX alone adds -ps, with -p additionally writing any of

to the standard output stream for each argument, depending on the situation, and -s silencing this.

IEEE Std 1003.2-1992 (“POSIX.2”) codifies -p in this behavioural shape, but strips the messages (and, hence, -s).

July 19, 2024 voreutils 5a9f9f29