how to delete all empty directories in linux


Delete the test1 directory, the directory is not empty, the deletion fails


rmdir -v test1/


rmdir :  delete if the directory is empty
-v, --verbose :  output deletion log


rmdir: removing directory, 'test1/'
rmdir: failed to remove 'test1/': Directory not empty
Was this helpful?

I hope to help every developer quickly find the commands they need. Of course, you can also add your own commonly used commands for easy searching.