Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialniklas12
604 PointsWouldn’t exporting "path" + $PATH in .bashrc multiply the "path"?
Adding export PATH="/home/user/bin:$PATH" to .bashrc would prepend an extra /home/user/bin to your PATH every time bash is run.
1 Answer
bothxp
16,510 PointsHi niklas,
Yes I do believe that you will see entries being added multiple times, as you are updating the PATH every time that the .bashrc is called.
I was hoping to be able to give you a simple answer that you should really be updating your PATH in the .bash_profile file, but it does appear that this can get a bit complicated depending on what you are trying to do and on which version of Linux you are using. If you are feeling brave then you can dive into the bash man page (the Invocation section) or you can start doing some web searches for 'bashrc vs bash_profile'.
Basically you can think of it as if you only want something to happen once then you'll place it in the .bash_profile file, but if you want it to run every time that you start a new bash instance then you'll put it in the .bashrc file.