I know there's a command to search for a file anywhere. It's a quite simple, 1 word command. Sadly, I forgot what it is.

So, let's say I want to search for a file name testingthis. The file could be anywhere in the system. How would I do it?

  • 1
    In your /home/<user_name> is a file called bash_history and it is a godsend. You can even clean it of duplicates and keep it from saving duplicates. I keep it saved and even import it across machines by moving it through my own network of keeping a reasonably recent backup "in the cloud." I've got stuff that I typed in bash from years ago! (This may help you in the future. I find it helps me more often than I care to admit.) – KGIII Nov 7 '15 at 10:51

You can use locate

locate testingthis

or find

find / -name testingthis

For locate the system has to build a database of files. If the database is not built it will not find anything. Also if you add new files they will not be found until the database is updated again. You can updated the database with updatedb.

  • locate is the one I was searching for. Thank you. – iamatrain Nov 7 '15 at 10:08

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.