Scroll to navigation

RMDIR(1) General Commands Manual RMDIR(1)

NAME

rmdir - Remove the DIRECTORY(ies), if they are empty.

SYNOPSIS

rmdir [--ignore-fail-on-non-empty] [-p|--parents] [-v|--verbose] [-h|--help] [-V|--version] <dirs>

DESCRIPTION

Remove the DIRECTORY(ies), if they are empty.

OPTIONS

ignore each failure that is solely because a directory is non-empty
remove DIRECTORY and its ancestors; e.g., 'rmdir -p a/b/c' is similar to rmdir a/b/c a/b a
output a diagnostic for every directory processed
Print help
Print version
<dirs>

VERSION

v(uutils coreutils) 0.9.0

EXAMPLES

Remove specific directories:

rmdir path/to/directory1 path/to/directory2 ...

Remove specific nested directories recursively:

rmdir [-p|--parents] path/to/directory1 path/to/directory2 ...

Clean a directory of empty directories:

rmdir *

The examples are provided by the tldr-pages project <https://tldr.sh> under the CC BY 4.0 License. Please note that, as uutils is a work in progress, some examples might fail.

2026-06-04