LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   in my path??? (https://www.linuxquestions.org/questions/linux-newbie-8/in-my-path-594582/)

vonedaddy 10-25-2007 01:39 PM

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.

Nylex 10-25-2007 01:43 PM

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.

pljvaldez 10-25-2007 01:43 PM

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.

vonedaddy 10-25-2007 01:45 PM

Ahh thank you, can you add a specific directory to your path?

Nylex 10-25-2007 02:04 PM

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

The_JinJ 10-25-2007 02:04 PM

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

vonedaddy 10-25-2007 02:26 PM

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

pljvaldez 10-25-2007 02:55 PM

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 11:11 PM.