LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 09-12-2004, 08:18 PM   #1
zchoyt
Member
 
Registered: Feb 2003
Location: Boise ID
Distribution: fedora
Posts: 156

Rep: Reputation: 30
add dirs to $PATH


Hey, I am trying to add more dirs to the $PATH variable. I tried adding:

PATH=new dir

to my .bashrc file. That really screwed me up, but I got it fixed.
Do I just have the syntax wrong? Should it be

PATH=$PATH:/new dir

Will that work? I dont wanna go through that mess again.

HAR HAR!
 
Old 09-12-2004, 08:19 PM   #2
zchoyt
Member
 
Registered: Feb 2003
Location: Boise ID
Distribution: fedora
Posts: 156

Original Poster
Rep: Reputation: 30
That would (if that is the way) add to the path of that user. I want to know that, but also want to know how to add to the path for all users.
 
Old 09-13-2004, 04:07 AM   #3
David the H.
Bash Guru
 
Registered: Jun 2004
Location: Osaka, Japan
Distribution: Debian + kde 4 / 5
Posts: 6,848

Rep: Reputation: 2012Reputation: 2012Reputation: 2012Reputation: 2012Reputation: 2012Reputation: 2012Reputation: 2012Reputation: 2012Reputation: 2012Reputation: 2012Reputation: 2012
In Debian at least, the default PATH is located in /etc/profile. If you modify it there it should be available to all users in all cases. .bashrc is only read by non-login shells, I believe.

If you only want to modify the PATH in order to make one or two programs work automatically, there's an easier way to do it. Just symlink the program file to a folder already in the path, like /usr/bin. Then bash should find it when it looks.
 
Old 09-13-2004, 01:43 PM   #4
Santas
Member
 
Registered: Jun 2003
Location: Over the rainbow
Distribution: Mandrake 10 / Guadalinex
Posts: 290

Rep: Reputation: 30
to canche your path you have to do 'export PATH=$PATH:/dir/to/the/dir' and you can include this in .bashrc of each user.
It must be a way to do it one time for all users but i don't know where to put it. Try searching in this forum and good luck.
 
Old 09-13-2004, 02:00 PM   #5
serz
Member
 
Registered: Apr 2003
Location: Buenos Aires, Argentina
Distribution: Slackware, Gentoo
Posts: 397

Rep: Reputation: 30
Santas is correct.

Now, if you only want this for your user then it's ok having that line in ~/.bashrc, if you want to make this general then you have to change /etc/profile.
 
  


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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
how do I add a path to the LD_LIBRARY_PATH abatista Linux - Newbie 7 01-05-2014 04:03 PM
Add path to @INC deus1 Linux - Software 0 07-27-2005 07:52 AM
How do I add library path? scc28y Linux - Newbie 5 03-18-2005 10:56 PM
add man path alaios Linux - General 2 03-14-2004 09:45 PM
How do I add something to my $PATH? iammeuno Linux - Software 1 12-18-2003 04:02 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

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