LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
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 03-07-2004, 10:17 PM   #1
h4dyce
LQ Newbie
 
Registered: Mar 2004
Location: Fort Collins, CO
Posts: 3

Rep: Reputation: 0
What is the PATH?


Subject says it all.
Thanks!
 
Old 03-07-2004, 10:21 PM   #2
watashiwaotaku7
Member
 
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
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,702

Rep: Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895
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:
./<executable_name>

To see your path
echo %PATH
 
Old 03-08-2004, 03:51 AM   #4
hw-tph
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.


Håkan
 
  


Reply



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

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

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

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
Open Source Consulting | Domain Registration