rmdir

Removes a directory

rmdir directory-list

The rmdir utility deletes empty directories from the filesystem by removing links to those directories.

Arguments

The directory-list contains pathnames of empty directories that rmdir removes.

Notes

Refer to the rm utility with the -r option if you need to remove directories that are not empty, together with their contents.

Examples

The following command line deletes the empty literature directory from the working directory:

$ rmdir literature
						

The next command line removes the letters directory, using an absolute pathname:

$ rmdir /home/jenny/letters
						

Get A Practical Guide to Red Hat® Linux® 8 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.