LinuxQuestions.org
Visit Jeremy's Blog.
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 02-15-2007, 11:24 AM   #1
jCash
Member
 
Registered: Sep 2006
Posts: 57

Rep: Reputation: 15
Editing $PATH on SUSE 10.1


I have multiple python installed. Version 2.4 and 2.5. I add same path twice to $PATH.
I want to edit $PATH, so I can erase the same stuff I added. How do I do this. In the path I have
home/me/bin:/usr/local/bin:/usr/bin. Python2.5 is in /usr/local/bin and Python2.4 is in /usr/bin. I need to set it so python2.4 is my preferred choice.
 
Old 02-15-2007, 11:43 AM   #2
Guttorm
Senior Member
 
Registered: Dec 2003
Location: Trondheim, Norway
Distribution: Debian and Ubuntu
Posts: 1,267

Rep: Reputation: 298Reputation: 298Reputation: 298
Hi

Just put /usr/bin before /usr/local/bin in the PATH. When you type some command, it looks in all directories in the PATH starting from left to right - that's why you get the one in /usr/local/bin.

export PATH="/usr/bin:$PATH"
- it doesn't matter if you put a directory twice in the PATH, it only get's a little bit slower.
 
Old 02-15-2007, 01:40 PM   #3
jCash
Member
 
Registered: Sep 2006
Posts: 57

Original Poster
Rep: Reputation: 15
"Just put /usr/bin before /usr/local/bin in the PATH." How? How do I edit the "PATH", where is it located? I understand I need to put /usr/bin before /usr/local/bin. But I don't know know. When I do export, it just appends to the end.
 
Old 02-15-2007, 03:10 PM   #4
nx5000
Senior Member
 
Registered: Sep 2005
Location: Out
Posts: 3,307

Rep: Reputation: 55
The PATH is an environment variable.
They are initially set in
/etc/profile -> for all users
or ~/.profile -> for one user
or ~/.bash_profile -> for one user that uses bash

Look in these files, probably that some PATH modifications are already done.
 
Old 02-15-2007, 03:41 PM   #5
jCash
Member
 
Registered: Sep 2006
Posts: 57

Original Poster
Rep: Reputation: 15
what is this "~"?

"or ~/.profile -> for one user"
Do I go to /home/username/.profile?

or ~/.bash_profile -> for one user that uses bash
Do I go /home/username/.bash_profile ?
 
Old 02-15-2007, 03:48 PM   #6
nx5000
Senior Member
 
Registered: Sep 2005
Location: Out
Posts: 3,307

Rep: Reputation: 55
Quote:
Originally Posted by jCash
what is this "~"?
~ is equivalent to $HOME, so probably /home/username
Quote:
"or ~/.profile -> for one user"
Do I go to /home/username/.profile?

or ~/.bash_profile -> for one user that uses bash
Do I go /home/username/.bash_profile ?
Yes.
I just had a look at my suse 10.2 and you can either put it in /etc/profile for all users or
/home/user/.profile for one single user

Put the line at the end
You have to restart your window manager so that changes apply. Because it's an environment variable, read and set once per session.
 
  


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
editing $PATH resist_r Linux - Newbie 3 07-09-2005 10:33 PM
Editing Path and LD_LIBRARY_PATH Nappa Slackware 5 11-24-2003 12:14 AM
PATH statement editing? cottonmouth Linux - General 2 08-17-2003 09:00 PM
PATH editing... Jester888 Linux - Newbie 2 01-23-2002 09:13 PM
Editing the PATH Cichlid Linux - General 3 01-06-2002 08:47 PM


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