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 |
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.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
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.
|
 |
10-25-2007, 01:39 PM
|
#1
|
Member
Registered: Aug 2004
Location: Philadelphia,PA
Posts: 185
Rep:
|
in my path???
I am very new to linux and am catching on fairly quickly. But the folks I work with who are old UNIX folks (all 50 + years old) use lingo that confuses me.
I tried to run a command with one of them over my shoulder.
They said "You do not have to type all that it is in your path".
What the heck does that mean? I dont have to specify a path to a file if it is in my path? How do I know what is in my path? and what exactly is my path?
Confused!!
Thanks in advance.
|
|
|
10-25-2007, 01:43 PM
|
#2
|
LQ Addict
Registered: Jul 2003
Location: London, UK
Distribution: Slackware
Posts: 7,464
Rep: 
|
PATH is an environment variable used to store a list of directories in which the shell looks for commands (executables). To see the list of directories listed in your PATH, run "echo $PATH" in a terminal (without quotes). FWIW, Windows also has an environment variable called PATH.
|
|
|
10-25-2007, 01:43 PM
|
#3
|
LQ Guru
Registered: Dec 2005
Location: Somewhere on the String
Distribution: Debian Wheezy (x86)
Posts: 6,094
|
http://www.faqs.org/docs/Linux-mini/Path.html
Your $PATH is basically a list of directories that the command line will look for when you type a one word command. For example, if /usr/bin is in your PATH and there is a program /usr/bin/firefox, you can just type firefox because it will look in /usr/bin for that program. If /usr/bin is not in your path and you type firefox, then it will return a "command not found" type error.
|
|
|
10-25-2007, 01:45 PM
|
#4
|
Member
Registered: Aug 2004
Location: Philadelphia,PA
Posts: 185
Original Poster
Rep:
|
Ahh thank you, can you add a specific directory to your path?
|
|
|
10-25-2007, 02:04 PM
|
#5
|
LQ Addict
Registered: Jul 2003
Location: London, UK
Distribution: Slackware
Posts: 7,464
Rep: 
|
Yes, of course you can. How you do so depends on the kind of shell you're using.
For bash and sh (possibly ksh as well, I'm not sure): export PATH=$PATH:/path/to/new/directory
For (t)csh (and whatever shells use the same syntax): setenv PATH {$PATH}:/path/to/new/directory
|
|
|
10-25-2007, 02:04 PM
|
#6
|
Member
Registered: Apr 2004
Location: Scotland
Distribution: Suse, OpenWRT
Posts: 299
Rep:
|
To add to the end of the path
Code:
PATH=$PATH:/whatever/path
By the way, you weren't actually wrong to use an absolute path, just could have saved a few keystrokes
|
|
|
10-25-2007, 02:26 PM
|
#7
|
Member
Registered: Aug 2004
Location: Philadelphia,PA
Posts: 185
Original Poster
Rep:
|
Well I thank you fine folks again, not only have I found a new interest in this open source community for its functionality but also because the people involved are so quick to help and share knowledge! Thanks again
|
|
|
10-25-2007, 02:55 PM
|
#8
|
LQ Guru
Registered: Dec 2005
Location: Somewhere on the String
Distribution: Debian Wheezy (x86)
Posts: 6,094
|
To make the change permanent between reboots, you have to add it to your profile or .bashrc (I think it differs depending on the distribution).
|
|
|
All times are GMT -5. The time now is 05:15 PM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|