LinuxQuestions.org
View the Most Wanted LQ Wiki articles.
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 01-26-2011, 12:28 AM   #1
wolfv
LQ Newbie
 
Registered: Feb 2010
Posts: 8

Rep: Reputation: 1
Question How to add a directory to PATH?


I carefully followed instructions on how to add a directory to PATH, but it's not working.
I export PATH from .bash_profile in my home directory, but when I rebooted, nothing was added to PATH.

Code:
~$ pwd
/home/wolf
~$ echo $SHELL
/bin/bash
~$ more .bash_profile
export PATH=$PATH:/home/wolf/.gem/ruby/1.8/bin
~/rspec/hello/spec$ printenv PATH
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games
When I add the same directory from the terminal, it works (until the session ends):

Code:
~$ export PATH=$PATH:/home/wolf/.gem/ruby/1.8/bin
~$ printenv PATH
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/home/wolf/.gem/ruby/1.8/bin
How to have a directory in PATH every time I boot?
I am running Ubuntu 10.4

Thank you
 
Old 01-26-2011, 12:59 AM   #2
crts
Senior Member
 
Registered: Jan 2010
Posts: 1,604

Rep: Reputation: 446Reputation: 446Reputation: 446Reputation: 446Reputation: 446
Hi,

try adding it in your .bashrc instead of .bash_profile. Do not forget to source it afterwards.
 
1 members found this post helpful.
Old 01-26-2011, 08:27 PM   #3
wolfv
LQ Newbie
 
Registered: Feb 2010
Posts: 8

Original Poster
Rep: Reputation: 1
Thumbs up

Thanks crts, that worked!
 
  


Reply

Tags
add, directory, path


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
Add directory to PATH JosephS Slackware 3 05-03-2008 11:17 AM
add a directory to PATH HarryBoy Linux - Newbie 5 05-02-2008 01:39 PM
Can't add directory to the PATH hpladd Linux - Newbie 5 07-25-2006 06:17 PM
I need to add a directory to the search path johnjafa Linux - Software 1 01-06-2005 02:43 PM
How to add a directory to PATH permantely paulmedic555 Suse/Novell 1 11-12-2004 04:58 PM


All times are GMT -5. The time now is 06:44 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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration