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 03-07-2004, 11: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, 11: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, 04:43 AM   #3
michaelk
Moderator
 
Registered: Aug 2002
Posts: 15,265

Rep: Reputation: 1624Reputation: 1624Reputation: 1624Reputation: 1624Reputation: 1624Reputation: 1624Reputation: 1624Reputation: 1624Reputation: 1624Reputation: 1624Reputation: 1624
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, 04: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


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 08:45 AM
Apache path and kde path questions darkraider Debian 1 11-12-2005 06:07 AM
Set the path systemwide/Set the path for a user with Slackware jayhel Slackware 1 06-12-2005 01:24 AM
Removing path form PATH maginotjr Linux - Newbie 3 02-12-2005 03:23 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 08:45 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration