LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
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 05-26-2004, 11:22 PM   #1
Itsu
Member
 
Registered: Jan 2004
Location: Gladstone, Oregon
Distribution: Gentoo 2005; FreeBSD 5.3
Posts: 32

Rep: Reputation: 15
PATH Issue


As of late, I am being required to change my PATH to include some more directories. I type the following command into Bash:

Code:
$  PATH=$PATH:[Insert Dir.]
This works, however, it is temporary. Whenver I close, and then open the terminal, it reverts back to what it used to be. Why does it do this? And how to I make it permanent?

Thank you!

Last edited by Itsu; 05-26-2004 at 11:23 PM.
 
Old 05-26-2004, 11:34 PM   #2
jeffreybluml
Member
 
Registered: Mar 2004
Location: Minnesota
Distribution: Fedora Core 1, Mandrake 10
Posts: 405

Rep: Reputation: 30
Put this in your /etc/bashrc file...

PATH=$PATH:/sbin/
PATH=$PATH:/usr/sbin/
export PATH


of course, change the paths to whichever suit you...

Now each time you open a terminal it should see this path...

Good luck!
 
Old 05-27-2004, 12:07 AM   #3
darthtux
Senior Member
 
Registered: Dec 2001
Location: 35.7480 N, 95.3690 W
Distribution: Debian, Gentoo, Red Hat, Solaris
Posts: 2,070

Rep: Reputation: 46
jeffreybluml is correct. Just to add: Changing the path in /etc/bashrc changes it for all users. If someone only wants to make changes for one user do the above in the users .bashrc located in their home directory.
 
Old 05-27-2004, 12:36 AM   #4
Itsu
Member
 
Registered: Jan 2004
Location: Gladstone, Oregon
Distribution: Gentoo 2005; FreeBSD 5.3
Posts: 32

Original Poster
Rep: Reputation: 15
Thanks, very helpful.
 
Old 05-27-2004, 10:58 AM   #5
mikshaw
LQ Addict
 
Registered: Dec 2003
Location: Maine, USA
Distribution: Slackware/SuSE/DSL
Posts: 1,320

Rep: Reputation: 45
You can save a line by cramming multiple paths together.
Instead of:

PATH=$PATH:/sbin/
PATH=$PATH:/usr/sbin/
export PATH

you can do:

PATH=$PATH:/sbin:/usr/sbin
export PATH
 
Old 05-27-2004, 02:04 PM   #6
darthtux
Senior Member
 
Registered: Dec 2001
Location: 35.7480 N, 95.3690 W
Distribution: Debian, Gentoo, Red Hat, Solaris
Posts: 2,070

Rep: Reputation: 46
You can simply it down to one line

export PATH=$PATH:/sbin:/usr/sbin
 
Old 11-17-2004, 12:47 PM   #7
Gins
Senior Member
 
Registered: Jul 2004
Location: Germany
Distribution: open SUSE 11.0, Fedora 7 and Mandriva 2007
Posts: 1,641

Rep: Reputation: 46
What is thie export command?

Is it a command or a file?

Where does it lie? I guess it is bin.

Please tell me.
 
Old 11-17-2004, 01:59 PM   #8
Itsu
Member
 
Registered: Jan 2004
Location: Gladstone, Oregon
Distribution: Gentoo 2005; FreeBSD 5.3
Posts: 32

Original Poster
Rep: Reputation: 15
The export command is integrated into bash. You need to open a shell and type the command, followed by the instructions.
 
Old 12-29-2004, 06:26 PM   #9
chin_chill
LQ Newbie
 
Registered: Nov 2004
Posts: 10

Rep: Reputation: 0
Question PATH

Hi,
I installed JDK1.0.5.0_01 on a Mandrake 10.1 System.
I am a Newbie but I thought I would find my way....
so first of all I edited /etc/profile and included PATH="$PATH:/usr/local/jdk1.5.0_01/bin" between umask 022 and USER='id -un'
than I restarted the session and typed: java -version
in the "normal" user mode I got the information (Version number and so on) but as root I didn't get it ( I got bash: java: command not found)
But I really need java for the root user to install OpenXchange.
Wich file do I have to edit to include the PATH for the root?

Please discribe it clearly ;-)


Last edited by chin_chill; 12-29-2004 at 06:28 PM.
 
Old 12-29-2004, 06:47 PM   #10
kevinalm
Member
 
Registered: Oct 2003
Location: Iowa
Distribution: LFS 5.0, building 6.3, win98se, multiboot
Posts: 288

Rep: Reputation: 30
root specific bash configuration:

/root/.bash_profile and /root/.bashrc

system wide can vary but usually:

/etc/profile and /etc/bashrc

individual users:

.bash_profile and .bashrc of the users home dir.
 
  


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
Path issue in Bash gd2shoe Linux - Software 2 08-28-2005 11:18 PM
$PATH duplicate set issue apocolpse Linux - Newbie 4 06-11-2005 06:35 AM
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 12:11 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