LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This 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


Reply
  Search this Thread
Old 11-17-2005, 01:50 PM   #1
das_Schaf
LQ Newbie
 
Registered: Oct 2004
Posts: 15

Rep: Reputation: 0
Smile Order of places to look for executables


Hi,
following question:

Whenever a user under any Linux system types a command (e.g. "who") as far as I know the system starts to look for an appropriate executable.
First in /bin then /etc, /sbin, /usr/bin, /usr/sbin.
Finally it would also try /home/*USER*
(I'm not sure if the items are in the right order but it ought to be something like this).

Now I got the problem that I got an executable in my home-folder which *has* to have a certain name which is also given to a rarely used executable in the /bin folder.

It is quite tiring to explain to everyone who uses the system that he/she should type in /home/*USERNAME*/*EXNAME* instead of just the name.

That is why I wonder if it is possible to change the order that the system looks for the executable for a user, so that it looks into /home/*USERNAME* at first and executes the executable there.

Thanks a lot in advance for the help

das_Schaf

P.S.
If anyone knows another way to have the system run the executable in the home-folder instead of the one in the /bin folder when typing it's name also that hint would be greatly appreciated!
 
Old 11-17-2005, 02:13 PM   #2
Haiyadragon
Member
 
Registered: Sep 2003
Location: Gorredijk, Netherlands
Distribution: Arch Linux
Posts: 400

Rep: Reputation: 30
I think it's the order the directory names are put in the $PATH variable. You could change that but maybe it's better/less trauma to system to create a script in /usr/local/bin that will run ~/yourapp. But since the one in /usr/bin is still run before /usr/local/bin the script has to have a different name.

Last edited by Haiyadragon; 11-17-2005 at 02:14 PM.
 
Old 11-17-2005, 02:18 PM   #3
das_Schaf
LQ Newbie
 
Registered: Oct 2004
Posts: 15

Original Poster
Rep: Reputation: 0
First of all thanks for the help.

Now this might be a stupid question but where exactly is the $PATH variable located? And furthermore, can I change it for specific users only to minimize the negativ effect?

Thanks!

Last edited by das_Schaf; 11-17-2005 at 02:20 PM.
 
Old 11-17-2005, 02:39 PM   #4
Haiyadragon
Member
 
Registered: Sep 2003
Location: Gorredijk, Netherlands
Distribution: Arch Linux
Posts: 400

Rep: Reputation: 30
Type "echo $PATH" in a terminal to see the contents. I'm not sure there will be a negative effect but I can imagine some bad scenarios.

You can use the ".bash_profile" file in the concerning home directory. This file will be run everytime somebody logs in. If the file exists maybe you could check if the path variable is already being altered there (debian, for example, does this by default I think) and change that. If not you can create the file and put something like "export PATH=~:$PATH" in it.
 
Old 11-17-2005, 02:46 PM   #5
das_Schaf
LQ Newbie
 
Registered: Oct 2004
Posts: 15

Original Poster
Rep: Reputation: 0
Thanks to you two.

That solved my problem. ^^
 
Old 11-17-2005, 02:57 PM   #6
Haiyadragon
Member
 
Registered: Sep 2003
Location: Gorredijk, Netherlands
Distribution: Arch Linux
Posts: 400

Rep: Reputation: 30
I'm actually one person But you're welcome.
 
Old 11-17-2005, 03:02 PM   #7
das_Schaf
LQ Newbie
 
Registered: Oct 2004
Posts: 15

Original Poster
Rep: Reputation: 0
Waaa.

I got to learn to read one of these days.
Or maybe I should just increase the amount of caffeine in my blood to make my brain work properly again. ^^
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Different laws in different places? harken General 4 08-26-2005 04:15 PM
The different places you see Linux Baix General 8 07-03-2005 08:26 AM
Places to go... UserNameHere Programming 1 02-08-2005 07:24 PM
Where Files Are Places easyex Linux - Newbie 0 03-21-2004 02:35 AM
a few places to get help Shrike Linux - Newbie 0 05-08-2002 12:37 AM


All times are GMT -5. The time now is 06:18 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration