How to locate files in linux

Hi! Have you ever needed to find some files in linux? Here’s a quick and easy “How To” on it. To locate files you can use the command “locate” (yes, to locate, use “locate”, pretty obvious, huh? :P). If you know the name of the file just launch a terminal and write:
locate "filename"
How to locate files in linux
If you don’t remember the exact name of the file but remember the file extension you can use the “*” operator. For example if you wanted to find an “.sh” file you could write:
locate "*.sh" 
However, it could return lots and lots of results. In order to view the list of found files in parts you could add ” | less” at the end of the command:
locate "*.sh" | less
Hope it’s helpful for you 🙂 Take care!

Did you find this post helpful? Do you wish to contribute to other projects regarding computer science, electronics, robotics or mechatronics that will be posted in this blog? If you wish to do so, you can donate via paypal using the button below. Thanks! 🙂