Latest LQ Deal: Linux Power User Bundle
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
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!


  Search this Thread
Old 02-05-2015, 09:34 AM   #16
LQ Newbie
Registered: Oct 2014
Distribution: CentOS
Posts: 16

Original Poster
Rep: Reputation: Disabled

To append a directory named 'bin' that is in your home directory to your PATH, put this in ~/.bashrc
export PATH=$PATH:~/bin
export PATH=$PATH:$HOME/bin
depending on whether or not the ~ or $HOME is easier for you to read in the future.
Will it work if I put that in .bash_profile? Also, how would appending my current working directory before appending bin work? Apparently by doing so, I should no
longer need to prefix ./ to execute something in my current directory.
Old 02-05-2015, 10:11 AM   #17
ReliaFree Maintainer
Registered: Aug 2004
Location: Kalamazoo, Michigan
Distribution: Slackware-current, Cross Linux from Scratch, Gentoo
Posts: 2,812
Blog Entries: 1

Rep: Reputation: 259Reputation: 259Reputation: 259
Originally Posted by whim View Post
Will it work if I put that in .bash_profile?
Only for login shells.
Old 02-05-2015, 04:11 PM   #18
LQ Newbie
Registered: Oct 2014
Distribution: CentOS
Posts: 16

Original Poster
Rep: Reputation: Disabled
Thanks for all your help.

Last edited by whim; 02-05-2015 at 05:03 PM.
Old 02-05-2015, 10:55 PM   #19
Senior Member
Registered: Mar 2005
Location: Earth bound to Helios
Distribution: Custom
Posts: 2,524

Rep: Reputation: 319Reputation: 319Reputation: 319Reputation: 319
# If not running interactively, don't do anything
[ -z "$PS1" ] && return
Also remove this from .bashrc


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

Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Questions about modifying bash_profile values, export, etc. sethbw Linux - Newbie 14 04-20-2012 03:11 PM
About .bash_profile ravi_nandula Linux - Newbie 3 04-10-2012 02:29 PM
bash_profile strycnine Slackware 5 10-22-2006 02:11 PM
where is ~/.bash_profile? Jskill007 Slackware 4 09-17-2004 11:04 PM
.bash_profile praveenv Linux - Newbie 3 08-14-2004 12:58 PM > Forums > Linux Forums > Linux - Newbie

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