Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
Go Back > Forums > Linux Forums > Linux - General
User Name
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.


  Search this Thread
Old 01-26-2011, 12:28 AM   #1
LQ Newbie
Registered: Feb 2010
Posts: 20

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.

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

~$ export PATH=$PATH:/home/wolf/.gem/ruby/1.8/bin
~$ printenv PATH
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
Senior Member
Registered: Jan 2010
Posts: 1,620

Rep: Reputation: 451Reputation: 451Reputation: 451Reputation: 451Reputation: 451

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
LQ Newbie
Registered: Feb 2010
Posts: 20

Original Poster
Rep: Reputation: 1
Thumbs up

Thanks crts, that worked!


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 / openSUSE 1 11-12-2004 04:58 PM > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 03:58 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration