| RMDIR(1) | User Commands | RMDIR(1) |
rmdir — remove
directories
/usr/bin/rmdir |
[-ps] dirname |
/usr/bin/rmdir |
[-eps] dirname ... |
The rmdir utility removes the directory
entry specified by each dirname operand, which must
refer to an empty directory.
Directories are processed in the order specified. If a directory
and a subdirectory of that directory are specified in a single invocation of
rmdir, the subdirectory must be specified before the
parent directory so that the parent directory is empty when
rmdir tries to remove it.
The rmdir built-in in
ksh93 is associated with the
/bin and /usr/bin paths. It
is invoked when rmdir is executed without a pathname
prefix and the pathname search finds a /bin/rmdir or
/usr/bin/rmdir executable.
The following options are supported for both
/usr/bin/rmdir and ksh93
rmdir:
-p-s-p is in effect.The following options are supported for the
rmdir built-in for
ksh93:
-e,
--ignore-fail-on-non-empty--parents-p.--suppress-s.The following operands are supported:
See largefile(7) for the
description of the behavior of rmdir when
encountering files greater than or equal to 2 Gbyte (2^31 bytes).
The following exit values are returned:
Example 1 Removing Empty Directories
If a directory a in the current directory is empty, except that it contains a directory b, and a/b is empty except that it contains a directory c, the following command removes all three directories:
example% rmdir -p a/b/cksh93 built-in binding to
/bin and /usr/bin is
Volatile. The built-in interfaces are Uncommitted.
ksh93(1), rm(1), unlink(2), attributes(7), largefile(7), standards(7)
| March 28, 2026 | OmniOS |