LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
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, 10: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, 10:43 AM   #2
Guttorm
Senior Member
 
Registered: Dec 2003
Location: Trondheim, Norway
Distribution: Debian and Ubuntu
Posts: 1,453

Rep: Reputation: 447Reputation: 447Reputation: 447Reputation: 447Reputation: 447
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, 12: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, 02:10 PM   #4
nx5000
Senior Member
 
Registered: Sep 2005
Location: Out
Posts: 3,307

Rep: Reputation: 57
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, 02: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, 02:48 PM   #6
nx5000
Senior Member
 
Registered: Sep 2005
Location: Out
Posts: 3,307

Rep: Reputation: 57
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



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

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

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