Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
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 03-07-2004, 10:17 PM   #1
LQ Newbie
Registered: Mar 2004
Location: Fort Collins, CO
Posts: 3

Rep: Reputation: 0
What is the PATH?

Subject says it all.
Old 03-07-2004, 10:21 PM   #2
Registered: Oct 2002
Location: wisconsin -- The Badger state
Distribution: gentoo
Posts: 654

Rep: Reputation: 30
PATH is the default "paths" that your shell will look in for a command, it enables you to type mozilla instead of /usr/bin/mozilla because it looks for an executable in your current directory, then starts at the topmost directory specified in PATH of which /usr/bin is a part I'm booted into windows now or else I would give you a list of what directories are in my path but for the most part they consist of /bin /sbin /usr/bin /usr/sbin/ and /opt
Old 03-08-2004, 03:43 AM   #3
Registered: Aug 2002
Posts: 17,604

Rep: Reputation: 2338Reputation: 2338Reputation: 2338Reputation: 2338Reputation: 2338Reputation: 2338Reputation: 2338Reputation: 2338Reputation: 2338Reputation: 2338Reputation: 2338
An environment variable
linux is different then windows. The shell does not look in the current directory first. To execute in the current working directory use:

To see your path
echo %PATH
Old 03-08-2004, 03:51 AM   #4
Senior Member
Registered: Sep 2003
Location: Sweden
Distribution: Debian
Posts: 3,032

Rep: Reputation: 58
I'd say echo $PATH works better.

To add a directory to the path, say the bin directory in your home folder, simply type as follows:
export PATH=$PATH:~/bin
The PATH environment variable is a colon-separated list of directories and in the line above we set the $PATH to what it was before, plus the ~/bin directory.

If you want to add a directory for to the path for all users you could put something like this in your /etc/profile:
export PATH=$PATH:/whatever/directory/you/want/to/add:/and/another/one

If you want to just do add it for yourself, add the above line to your ~/.bashrc and make sure ~/.bashrc is sourced (executed) from your ~/.bash_profile.



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 06:43 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration