LinuxQuestions.org
Share your knowledge at the LQ Wiki.
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-25-2011, 11:28 PM   #1
wolfv
Member
 
Registered: Feb 2010
Posts: 30

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-25-2011, 11:59 PM   #2
crts
Senior Member
 
Registered: Jan 2010
Posts: 2,020

Rep: Reputation: 757Reputation: 757Reputation: 757Reputation: 757Reputation: 757Reputation: 757Reputation: 757
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, 07:27 PM   #3
wolfv
Member
 
Registered: Feb 2010
Posts: 30

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

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

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