Friday, January 18, 2008

HowTo: Find Hidden Directory Folders Recursively

The title says it all, how to find hidden directory folders recursively.

There are times we need to list down all hidden directories from a file system or display all hidden directory folder from a client home folder, this task can simply be done using linux find command.

How to find hidden directory folder recursively?

Let us create hidden directory folders that starts with dot (.) before their name
# mkdir /tmp/.hidden1
# mkdir /tmp/.hidden2

Now, let us find the newly created hidden folder
# find /tmp -name '.*' -type f
Result:
~~~~~~~~~~~~~~~~~~~~~~~~
/tmp/.hidden1
/tmp/.hidden2
~~~~~~~~~~~~~~~~~~~~~~~~

Apply to a client's request named customerA

# find ~customerA -name '.*' -type f
Result:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/customerA/.ICEauthority
/home/customerA/.kde/Autostart/.directory
/home/customerA/.bashrc
/home/customerA/.bash_history
/home/customerA/.bash_profile
/home/customerA/.xsession-errors
/home/customerA/.bash_logout
/home/customerA/.gtk-bookmarks
/home/customerA/.zshrc
/home/customerA/.htaccess
/home/customerA/.dmrc
/home/customerA/.gnome/gnome-vfs/.trash_entry_cache
/home/customerA/.pulse-cookie
/home/customerA/.gtkrc-1.2-gnome2
/home/customerA/.tomboy.log
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Enjoy.

Related Readings:
List Out Hidden Directory Folder and Files
Rename Multiple Files Recursively
Create Hidden Directory Folder

0 comments:

Sign up for PayPal and start accepting credit card payments instantly.
ILoveTux - howtos and news | About | Contact | TOS | Policy