Download your favorite Linux distribution at LQ ISO.
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 08-30-2005, 04:06 AM   #1
LQ Newbie
Registered: Aug 2005
Location: Singapore
Distribution: Red Hat Enterprise Linux WS
Posts: 5

Rep: Reputation: 0
Question PATH problem


Currently I am having some problem setting the path.

If I used the command:

followed by a

echo $PATH

I can see that the new path is included. However, if I restart my terminal. This path will be gone. Therefore using the above command only set the path temporarily. Can someone enlighten me how to set a path permanently?

Thanks in advance.

Old 08-30-2005, 04:22 AM   #2
Senior Member
Registered: Jul 2004
Location: Lower Rhine region, Germany
Distribution: Slackware64 14.2 and current, SlackwareARM current
Posts: 1,634

Rep: Reputation: 144Reputation: 144
EDIT: Ups, I probably didn't get it right:

export PATH=...

if you want it to last for one session. But this doesn't last til the next boot.
You should look at /etc/profile, there should be the general PATH definition for all users. Alternatively you can change the bash config files in your home directory (I always confuse them, I think .bashrc or .bash_profile should be the ones).

Last edited by titopoquito; 08-30-2005 at 04:30 AM.
Old 08-30-2005, 09:48 AM   #3
LQ Newbie
Registered: Aug 2005
Distribution: Fedora Core 4
Posts: 7

Rep: Reputation: 0
hmm, I think the PATH settings go in your .login don't they? I don't think you put them in your .cshrc although it may work from there.

I have the following in my .login (in my home dir) and it works fine:

setenv PATH {$PATH}:/loc/zagato/bin
Old 08-30-2005, 09:57 PM   #4
Senior Member
Registered: Nov 2003
Location: Perth, Western Australia
Distribution: Ubuntu, Debian, Various using VMWare
Posts: 2,088

Rep: Reputation: 62
If you are using bash (Find out using "echo $SHELL"), then you need to add the line
export PATH=$PATH:/opt/xxx/xxx
to your .bashrc or .bash_profile.

As far as I know, .login is for tcsh or csh, which most people dont use. Of course, if you do use tcsh, then add the setenv line to .login.

I hope this helps
Old 08-31-2005, 10:11 PM   #5
LQ Newbie
Registered: Aug 2005
Location: Singapore
Distribution: Red Hat Enterprise Linux WS
Posts: 5

Original Poster
Rep: Reputation: 0
Hi all,

Thanks for all the valuable advices. I've managed to set the path "permanently" after adding the line
to the /etc/profile file.

Thanks for all the help.

With regards,


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
qt path problem wmeler Linux - Software 0 05-13-2004 11:20 PM
How to Chnage Python's module search path (sys.path)? lramos85 Linux - Software 1 05-02-2004 07:10 PM
PATH problem jhansman Linux - Newbie 18 08-24-2003 02:15 AM
a path problem Santas Linux - Newbie 6 07-02-2003 04:40 PM
$PATH problem charlie123 Linux - Newbie 3 01-15-2003 05:50 PM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 11:20 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
Open Source Consulting | Domain Registration