Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Where is the .profile file on mac?

I have a MacBook Pro 13` inch (without touch bar) and it is running mac os sierra. I have installed Xcode, command line tools and homebrew. Now I want to install python 3 and make it a default interpreter when calling it from the terminal. I have found this guide http://docs.python-guide.org/en/latest/starting/install3/osx/ and I get confused when they say I should add the path to the ~./profile but I don't know where to find the file. Can somebody help with step by step guide on how to create it if it not there?

Thanks

like image 730
Andile Avatar asked Apr 24 '18 09:04

Andile


People also ask

Where is .profile file located?

The . profile file is present in your home ($HOME) directory and lets you customize your individual working environment. Because the . profile file is hidden, use the ls -a command to list it.

How do I edit .profile on Mac?

Edit a configuration profileSelect the device, user, or group, then click the Edit button next to the configuration profile you want to edit, then use the payload editing panes to make changes. Click Save.

Where are Terminal profiles stored Mac?

apple. Terminal. savedState, and then remove the word "copy" from the end. Open Terminal, and you should see all of your profiles.


2 Answers

On Mac, zsh is the default shell. You can check this by running

echo $SHELL

If so, you can check for ~/.zshrc if not you can create one and add required commands, alias which need to run during the terminal startup.

Then you can run

source ~/.zshrc

This will be executed every time the terminal is opened.

like image 157
user2216322 Avatar answered Oct 20 '22 23:10

user2216322


I felt to add something here that ate a lot of my time when I had a similar issue.

Many a times the .profile or the .bash_profile (in case of bash shell) is not present. This is typically when you have freshly installed the OS or when you're on a new machine. This gets confusing as one may think if the installation wasn't correct etc. Nothing to worry about. If you don't find these files then simply create it new using vi or whatever means (GUI) and you're good to go. Having a shell doesn't mean you have these files too and you have to create it yourself if you're the first one to use it.

like image 38
Saurabh Patil Avatar answered Oct 21 '22 01:10

Saurabh Patil