Review your favorite Linux distribution.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
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!


  Search this Thread
Old 01-30-2005, 11:10 AM   #1
LQ Newbie
Registered: Jan 2005
Posts: 2

Rep: Reputation: 0
about PATH

hello I would like to ask
for example if my PATH variable is set like this
so it will search files in dir01 first,
but if I have the same program but in 2 versions, one in dir01, and another in dir02, if I want it to excute the one in dir02, but dont want to alter the PATH to /usr/dir02:/usr/dir01, so can I just only set a particular path to a particular program ?
Old 01-30-2005, 11:15 AM   #2
Registered: Mar 2003
Location: Scotland
Distribution: Slackware, RedHat, Debian
Posts: 12,047

Rep: Reputation: 79
Welcome to LQ.

PATH can only be used to store directory names. You could create an alias to get around the problem:
alias myprog="/usr/dir02/myprog"
Old 01-30-2005, 11:22 AM   #3
Senior Member
Registered: Jan 2004
Location: Montpellier (France)
Distribution: Gentoo
Posts: 1,014

Rep: Reputation: 36

As David_ross says: you can choose the alias way... or a similar tip is to launch your prog with full path and a last solution is to use a symbolic link:
ln -s /usr/dir02/my-prog /usr/dir01/my-prog2
and you run it as my-prog2

Old 01-30-2005, 11:50 AM   #4
LQ Newbie
Registered: Jan 2005
Posts: 2

Original Poster
Rep: Reputation: 0
Hello, thank you very much, seems like I have a long way to learn ^^
just started to use linux, complicated but fun


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
Image Path reference in Linux (Absolute path) javabuddy Linux - General 7 06-05-2006 07:45 AM
Apache path and kde path questions darkraider Debian 1 11-12-2005 05:07 AM
Set the path systemwide/Set the path for a user with Slackware jayhel Slackware 1 06-12-2005 12:24 AM
Removing path form PATH maginotjr Linux - Newbie 3 02-12-2005 02:23 PM
How to Chnage Python's module search path (sys.path)? lramos85 Linux - Software 1 05-02-2004 06:10 PM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 05:10 PM.

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