Randika Says

Life Experiences and Experiments of a Software Developer…

Memos to Myself – Creating or Editing .bash_profile in Mac

Same alike setting PATH variables in Windows, in some cases you will want to set paths in Mac too, so you can use certain functions from your terminal app (CLI). To do that you have to create a `.bash_profile` file and update it, as it won’t be created automatically from OS X for you.

Airport-terminal

Terminals where used in real life. 😉

Fire up Terminal, and then:

  1. Type “cd ~/” to go to your home folder
  2. If you have already created a .bash_profile file then to edit it in a text editor:
    open .bash_profile
  3. If you haven’t created a .bash_profile file yet, then to create a .bash_profile file, in the terminal type:
    touch .bash_profile
  4. So now you have a .bash_profile and added new functionality. But yet the terminal you have opened may not noticed about it. So type “. .bash_profile” to reload .bash_profile and notify the terminal about the functions you newly added.

It’s that simple! 🙂

 

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Information

This entry was posted on July 8, 2015 by in Code Snippets, Memos and tagged , , , , , , , , , .
%d bloggers like this: