Files & Folders Lens can be used to locate user's documents easily, but it seems ignoring system files and folders.

How can I search & locate system files and folders?

(Say for example I want to locate a folder named .metadata, which contains some settings of my Eclipse IDE, and I know that this folder is there in the file system somewhere but I don't know where)

I use 12.04 LTS


2 Answers 2


You can use the find command to find folders with the -type d parameter. Here are a few examples:

#Search Root ( / ) folder for a folder called www

nits@excalibur:~$ sudo find / -name www -type d

#Search current folder for a folder which start either Capital/lower-case M

nits@excalibur:~$ find . -iname m* -type d
./.cache/chromium/Default/Media Cache

In the above examples, you would have noticed that only the directories with no subdirectories in them are listed. You can use mindepth/maxdepth to set the depth of the level that needs to be traversed.

#Search current directory for directories starting with either capital/lower-case M but only are present in the current directory

nits@excalibur:~$ find . -maxdepth 1 -iname m* -type d

# Traverse two levels (current level and one level under) in the current directory for directories starting with either capital/lower-case M:

nits@excalibur:~$ find . -maxdepth 2 -iname m* -type d

There are a whole load of different options to search directories and files as well using find, you can look through the man-page accessible by man find for all the options and how to use it. Also although find is slower than locate it doesn't require updatedb to update a DB to search through because the search is performed real-time.


Use the locate command. It uses a database that gets updated via updatedb. I have a cron job that runs updatedb every hour so the database is up-to-date.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.