.profile in Mac OS X?

22

3

I have set my terminal preferences to execute:

 set -o vi 

at startup. The problem is I don't get that command executed when open a new terminal tab.

Is there something like .profile in OS X where I can put that command?

OscarRyz

Posted 2009-07-15T11:41:38.123

Reputation: 3 691

Answers

28

The .profile file in MacOSX works exactly how you would expect. Simply create the .profile file in your user directory if it doesn't exist.

Simone Carletti

Posted 2009-07-15T11:41:38.123

Reputation: 1 012

does profile require #!/bin/bash header? – the_prole – 2018-11-20T21:03:11.060

Ooohhh!!! Thank you. I got confused by the fact it wasn't there. I've create it and runs perfectly. Years ago OXS used tcsh, do you know which one is used currently? bash I guess? – OscarRyz – 2009-07-15T11:51:28.490

3Yes, by default Terminal uses bash. – Simone Carletti – 2009-07-15T12:33:28.457

12

Because, as noted, Terminal has used bash by default for a few versions, you may want to keep an eye out for a .bash_profile file if .profile isn't present. See the "which startup files are read by the shell?" FAQ at http://hayne.net/MacDev/Notes/unixFAQ.html#shellStartup which explain how the different files are used and the order in which they're read at startup.

pjmorse

Posted 2009-07-15T11:41:38.123

Reputation: 305