Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I recently tried to locate a file called id_rsa to figure out whether a user had already generated public key. I ran locate id_rsa, but nothing showed up. I even searched for .ssh but couldn't find it. The folder exists and so does the file, but the folder is hidden.

So, how do I get locate to actually look through every single file and folder on the system?

share|improve this question
    
Did you do sudo /usr/libexec/locate.updatedb first? –  Justin Pearce Jun 28 '12 at 14:08
    
What is that supposed to do? –  Jeremy Detrempe Jun 28 '12 at 23:14
    
It's supposed to regenerate the database that locate uses for locating files. If the file is recent, it is possible that it hasn't made it into the database yet. –  Justin Pearce Jun 29 '12 at 14:24
add comment

1 Answer

up vote 1 down vote accepted

Well this is an approach using find:

find /path/folder -maxdepth 1 -type f -iname ".*"

You can use " * " instead of "/path/folder" to search every place. Also you can modify -maxdepth for the amount of subfolders you want to go search into and -type d if you want to search for a folder instead of a file.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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