Delete / Remove a Directory Linux Command

$ rmdir /tmp/docs
If directory is not empty you will get an error:
$ rmdir letters

rmdir: letters: Directory not empty

You can change directory to find out files:
$ cd letters
$ ls

Linux remove entire directory

To remove all directories and subdirectories use rm command. For example remove letters and all subdirectories and files inside this directory, type the following command:
$ rm -rf letters/

Leave a comment