LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
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, 03: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, 03:22 AM   #2
titopoquito
Senior Member
 
Registered: Jul 2004
Location: Lower Rhine region, Germany
Distribution: Slackware64 14.2 and current, SlackwareARM current
Posts: 1,644

Rep: Reputation: 145Reputation: 145
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 03:30 AM.
 
Old 08-30-2005, 08: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, 08: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, 09: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 10:20 PM
How to Chnage Python's module search path (sys.path)? lramos85 Linux - Software 1 05-02-2004 06:10 PM
PATH problem jhansman Linux - Newbie 18 08-24-2003 01:15 AM
a path problem Santas Linux - Newbie 6 07-02-2003 03:40 PM
$PATH problem charlie123 Linux - Newbie 3 01-15-2003 04:50 PM

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

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