How To

How to Locate empty directories in Linux using Terminal ?

To locate empty directories in Linux using the terminal, we will use the find command with the -empty option. Here is the...

Written by Bikash · 31 sec read >

To locate empty directories in Linux using the terminal, we will use the find command with the -empty option. Here is the working command,

The above command will search for empty directories under the specified path /path/to/search or directory.

Locate empty directories in Linux
Locate empty directories in Linux using Terminal

We can also use the -print option to print the names of the empty directories that are found:

By using the -delete option to delete the empty directories that we are found,

Note that the find command is very powerful and has many options and features. You can use the man find command to get more details about how to use it.

Also Read:

Happy Coding..!

Was this article helpful?
YesNo
Written by Bikash
My name is Bikash Kr. Panda. I own and operate PHPCODER.TECH. I am a web Programmer by profession and working on more than 50 projects to date. Currently I am working on the web-based project and all the CMS and frameworks which are based on PHP. Profile

Leave a Reply

Your email address will not be published. Required fields are marked *