LinuxQuestions.org
Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
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 10-25-2007, 02:39 PM   #1
vonedaddy
Member
 
Registered: Aug 2004
Location: Philadelphia,PA
Posts: 180

Rep: Reputation: 17
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.
 
Old 10-25-2007, 02:43 PM   #2
Nylex
LQ Addict
 
Registered: Jul 2003
Location: London, UK
Distribution: Slackware
Posts: 7,464

Rep: Reputation: Disabled
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.
 
Old 10-25-2007, 02:43 PM   #3
pljvaldez
LQ Guru
 
Registered: Dec 2005
Location: Somewhere on the String
Distribution: Debian Wheezy (x86)
Posts: 6,094

Rep: Reputation: 271Reputation: 271Reputation: 271
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.
 
Old 10-25-2007, 02:45 PM   #4
vonedaddy
Member
 
Registered: Aug 2004
Location: Philadelphia,PA
Posts: 180

Original Poster
Rep: Reputation: 17
Ahh thank you, can you add a specific directory to your path?
 
Old 10-25-2007, 03:04 PM   #5
Nylex
LQ Addict
 
Registered: Jul 2003
Location: London, UK
Distribution: Slackware
Posts: 7,464

Rep: Reputation: Disabled
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
 
Old 10-25-2007, 03:04 PM   #6
The_JinJ
Member
 
Registered: Apr 2004
Location: Scotland
Distribution: Suse, OpenWRT
Posts: 299

Rep: Reputation: 30
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
 
Old 10-25-2007, 03:26 PM   #7
vonedaddy
Member
 
Registered: Aug 2004
Location: Philadelphia,PA
Posts: 180

Original Poster
Rep: Reputation: 17
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
 
Old 10-25-2007, 03:55 PM   #8
pljvaldez
LQ Guru
 
Registered: Dec 2005
Location: Somewhere on the String
Distribution: Debian Wheezy (x86)
Posts: 6,094

Rep: Reputation: 271Reputation: 271Reputation: 271
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).
 
  


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
export Path=/usr/java:$Path does not seem to work lumix Linux - Newbie 1 03-19-2007 04:11 PM
Image Path reference in Linux (Absolute path) javabuddy Linux - General 7 06-05-2006 08:45 AM
script to change unix path to windows path in all files csross Programming 8 04-29-2006 02:05 PM
Why is the value of $PATH in console mode different from the $PATH in xterm emulator? Akhran Debian 9 03-09-2006 07:10 PM
How to Chnage Python's module search path (sys.path)? lramos85 Linux - Software 1 05-02-2004 07:10 PM


All times are GMT -5. The time now is 10: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