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

Notices


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

Original Poster
Rep: Reputation: Disabled

Quote:
To append a directory named 'bin' that is in your home directory to your PATH, put this in ~/.bashrc
Code:
export PATH=$PATH:~/bin
or
Code:
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, 11:11 AM   #17
weibullguy
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
Quote:
Originally Posted by whim View Post
Will it work if I put that in .bash_profile?
Only for login shells.
 
Old 02-05-2015, 05:11 PM   #18
whim
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 06:03 PM.
 
Old 02-05-2015, 11:55 PM   #19
veerain
Senior Member
 
Registered: Mar 2005
Location: Earth bound to Helios
Distribution: Custom
Posts: 2,524

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


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 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 04:11 PM
About .bash_profile ravi_nandula Linux - Newbie 3 04-10-2012 03:29 PM
bash_profile strycnine Slackware 5 10-22-2006 03:11 PM
where is ~/.bash_profile? Jskill007 Slackware 4 09-18-2004 12:04 AM
.bash_profile praveenv Linux - Newbie 3 08-14-2004 01:58 PM


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