Wednesday, November 12, 2008

List empty directories using find in bash

Linux command find gives an option called "empty" using which we can list empty regular files or empty directories.


To list all the empty directories

$ find . -type d -empty



Related post:

- find file names with only digits, no text
- Use logical operator with linux find command
- exclude directory from find command


atoztoa said...

The problem with lots of us is that, we never even read the --help page for a command.

I never knew there was -empty for find, lol ;)


Unknown said...


same for me :-) . Thanks for commenting.


© Jadu Saikia