How do I delete / remove a directory under UNIX operating systems?
You need to use rmdir command to remove a directory. It will remove the directory entry specified by each dirname operand, which must refer to an empty directory.
For example, to remove a directory called "cppcode", enter:
Note: A directory must be empty before it can be removed. Use rm command to remove all files from a directory:
You can also recursively remove directories and subdirectories. The directory will be emptied of files and removed using rm command:
rm -r oldletters