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

Rep: Reputation: 0
Question PATH problem


Hi,

Currently I am having some problem setting the path.

If I used the command:
PATH=$PATH:/opt/xxx/xxx

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.

wiki
 
Old 08-30-2005, 04:22 AM   #2
titopoquito
Senior Member
 
Registered: Jul 2004
Location: Lower Rhine region, Germany
Distribution: Slackware 14.1 (32 and 64 bit)
Posts: 1,590

Rep: Reputation: 122Reputation: 122
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
Tux136
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:

Code:
setenv PATH {$PATH}:/loc/zagato/bin
 
Old 08-30-2005, 09:57 PM   #4
IBall
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
Code:
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
--Ian
 
Old 08-31-2005, 10:11 PM   #5
wiki
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
PATH=$PATH:/opt/xxx/xxx
to the /etc/profile file.

Thanks for all the help.

With regards,
Wiki
 
  


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
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


All times are GMT -5. The time now is 08:22 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