Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
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.
I'd like to know how to change the whereis database, or how it looks for the best command to use. I've updated the locate database but it's not using that as there was no change.
For example, I have a system built version of perl in /usr/bin, but I built a newer one in /usr/local/bin. Running 'whereis perl' in a terminal returns /usr/bin/perl.
I can't find how to do this via a search, would anyone know the answer? Any help would be much appreciated.
This is for an OSX 10.4 box, and the whereis on here doesn't take args.
AFAIK, whereis searches via your PATH, so you would need to add /usr/local/bin to your PATH. http://www.faqs.org/docs/Linux-mini/Path.html should be useful to you in understanding and changing the PATH on your system for your users.
I'd like to know how to change the whereis database, or how it looks for the best command to use. I've updated the locate database but it's not using that as there was no change.
For example, I have a system built version of perl in /usr/bin, but I built a newer one in /usr/local/bin. Running 'whereis perl' in a terminal returns /usr/bin/perl.
I can't find how to do this via a search, would anyone know the answer? Any help would be much appreciated.
This is for an OSX 10.4 box, and the whereis on here doesn't take args.
I may have misunderstood, but I don't think that 'whereis' does what you think it does. The 'whereis' command is a convenience to users to help them locate commands. So, if a command is not executing, a 'whereis' helps you to check that its in your path and have the a[ppropriate rights. That's useful.
When, however, you want to execute 'command_name' the system walks your path itself; it tries '/this/that/command_name' (where this/that/ is the first element in your path) and if that executes, you are in business. If not, it tries /'the/other/command_name' (where the/other/ is the second element in your path)... And, so on.
So, whereis isn't used at this stage. And what gets executed is the first matching element in your path; coming second is coming nowhere. And note that when I say 'you are in business' this is not necessarily the business that you had wanted to be in.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.