I‘m new to Linux and I’d like to know how to delete directory under any Linux distributions?
You need to use the command called rmdir. It remove empty directories.
rmdir command syntax
rmdir [OPTION] {directory-name} |
rmdir [OPTION] {directory-name}
Delete / remove directory
To delete directory called foo, enter:
rmdir foo
Remove DIRECTORY and its ancestors
For example remove directory structure sales/99/march
rmdir -p sales/99/march
Recursive delete
Remove all directories and subdirectories, use rm command with -r option:
rm -rf /home/data/2000
Please note that rmdir command works with all Linux and Unix like operating systems. For more information read rm and rmdir command man pages:
man rm
man rmdir