I just did a clean install of OS X Lion and I see that now I have no .bash_profile file in my home directory.

Should I create this by hand? (I want to save in it some alias.)

Thank you.

PS : The only file that exist now that I could use is /etc/profile


By default this file does not exist on any version of OS X. And yes, it is up to you to create it manually:

touch ~/.bash_profile

Alternatively, you could use nano as well if you want to edit the file at the same time:

nano ~/.bash_profile

Do not monkey in /etc unless you know what you're doing.

| improve this answer | |
  • Thank you for your answer.I just created the file and it worked fine after opening a new terminal window – skiabox Oct 7 '11 at 10:53
  • 1
    You are welcome. If it solved your problem, please mark it as such to let others know if they ever reference this thread :) – user10355 Oct 7 '11 at 10:54
  • Is there a reference in the OSX documentation for this? – blong Sep 25 '13 at 19:23
  • @b.long I haven't see one. Not that I scoured it, but Apple doesn't tend to publicize UNIX config files. They tend to focus on making their OSes as less scary as possible. But since OS X is fully UNIX 3.0 compliant, anything that works in Linux works here. You can simply google "bash_profile" or "bashrc" (here's a good primer on the difference between the two: joshstaiger.org/archives/2005/07/bash_profile_vs.html). – user10355 Sep 26 '13 at 3:06

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .