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 trialLukas Coffey
20,382 PointsWhat is .bashrc on a mac?
I am using a mac. There is a .bash_history file but that is all. No .bash_profile or .bashrc in my home directory. Do I have to create this file or is it somewhere else? Thanks in advance.
3 Answers
shezazr
8,275 Pointsyou can create it in the same folder as bash_profile..
Felix Salazar
3,879 PointsThe answers is simply: Yes, you can and you have to create it if it doesn't exist.
Lawrence Francell
Courses Plus Student 17,992 PointsTL;DR; The file is ".bash_profile" preceded by a period
MORE: In your home directory or ~/ there are hidden files (also referred to as "dot files") because they start with a period. They are not visible in finder so that most typical users will never see or interact with them. unless you use a tool like ONYX or it's command equivalent to set them visible "Show hidden files"
You can edit it with this command from wherever you are in your directories nano ~/.bash_profile
OUT OF SCOPE: also if you want to see the other finder hidden "dot files" in your home directory change directory to home cd ~/
Then run ls (lowercase "ell" "ess") for list followed by -la ls -la (these modifier keys are combined lowercase "ell" lowercase "a" preceded by a dash "-l" = in a list format instead of lumped across in a row. "-a" = all entries in the directory.
Read more about ls by reading the manual page man ls
You will see the first item is "." and the second is ".."
These are command reference to the self and parent, respectively. In every directory they exist to point commands places.
If you have atom installed and want to open the folder in atom you could type atom ./ or want to see the contents of the file in Finder open ./
Or, change directory dot dot slash takes you up to the parent cd ../
and can be chained as in ../../../../../ all the way up the hierarchy to root directory
EXPANDED FURTHER: Remember root directory is represented by /
so from where ever you may be in your directory hierarchy aka $PATH you can type cd / and get to the root of your filesystem. much like" cd ~/" will take you to the "root" of the current users home folder
for the best help, read the man pages Happy sleuthing, LF
Lukas Coffey
20,382 PointsLukas Coffey
20,382 PointsBut there is no bash_profile either. Nothing except bash_history.