Linux - SoftwareThis forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.
Notices
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.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Couple of questions about that.
1. Do you need to run a command like updatedb first?
2. It also seems to spit out more than one output. Are these depenancies or something?
run 'updatedb' (you did that) then use locate but pipe the output to less, or better yet
'grep' it first. Grep is the super geeky unix program that lets you search for patterns within strings (ok, maybe its not that geeky). It will allow you to filter the output a bit. 'less' is a program that displays output in such a way that you can scroll up and down through it to read it all (kinda like a really simple readonly text editor).
something like 'locate mount|grep bin|less' will look for everything on your computer with mount in it, then only display the results that ALSO had 'bin' in them, then display it all in less so you can read it before it whizzes past your eyes.
There are some good tutorials around as well, try something like 'grep tutorial' or 'locate tutorial' in Google.
Cool, thankx for the tips. I am getting used to linux env still. I did know about those commands but didn't think about using them together like that. It worked pretty well.
locate bin/mount will also work. grep is not needed. The 'which' command will tell you the program that is actually run with a command, even if it's aliased or whatever. It does not use the locatedb but uses the environment (e.g. PATH).
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.