Can someone give me tips on using the 'locate' command - with examples?
Linux - GeneralThis Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Introduction to Linux - A Hands on Guide
This guide was created as an overview of the Linux Operating System, geared toward new users as an exploration tour and getting started guide, with exercises at the end of each chapter.
For more advanced trainees it can be a desktop reference, and a collection of the base knowledge needed to proceed with system and network administration. This book contains many real life examples derived from the author's experience as a Linux system and network administrator, trainer and consultant. They hope these examples will help you to get a better understanding of the Linux system and that you feel encouraged to try out things on your own.
Click Here to receive this Complete Guide absolutely free.
'locate' can also be combined with 'grep' (ok, that should be obvious), to useful effect;
So, eg, if what you know is that the file that you are looking for, you probably stored in your downloads directory and it probably was a pdf file
locate downloads | grep -i pdf
might get you closer. Still not close enough? Well, let's say it also concerned ubuntu, maybe
locate downloads | grep -i pdf |grep -i ubuntu
is the thing that gets you there. More than that ought to be an application of similar principles and possibly a careful reading of the man page. Anything really clever, and you'll probably need 'find' instead.