9

For some reason after I installed Boot Camp, my os x terminal started to point to the Boot Camp drive instead of my os x home directory by default! Once in the terminal I know how to switch back an forth and am able to do that, but I was wondering how to make my terminal default back to my os x home folder?

I've checked my Home Directory under System Preferences->Accounts->Control-click on my account and it is pointing to the right place. I've also tried unmounting it with no luck.

Mac
  • 2,693
  • 7
  • 36
  • 44

2 Answers2

17

This is a bit of under-the-hood fiddling, but you could simply enter

cd <directory>

in /Users/<yourUserName>/.profile

and startup a new terminal. You should then be in the directory you want.

Thorsten79
  • 10,038
  • 6
  • 38
  • 54
  • Doesn't it seem rather unlikley the .profile in his home directory will be read, if that is not where the terminal starts? It does however raise the question, is there something in his existing .profile that is changing directories when he opens Terminal? "cd ~" and see where you end up. – Kendall Helmstetter Gelner Sep 28 '08 at 06:25
  • Good idea. I think you're right about the .profile not being found. Didn't think about that. – Thorsten79 Sep 28 '08 at 06:54
  • This answer helped me. I was trying to change the default directory of terminal. Thanks. – Kevin Dewalt Jul 19 '09 at 12:15
  • This answer also helped me. I too was trying to set the default directory of terminal. – John Gallagher Jan 15 '10 at 10:14
  • 7
    In case you're reading this from the future, you can do this in `~/.bash_profile.` – Eric Yang Dec 02 '11 at 17:51
  • My .profile file definitely gets read (it's got an echo in it to confirm), but my terminals open with the same current working directory as the previous tab. – Rikki Feb 11 '15 at 09:31
4

You probably want these instructions for how to use the command line:

https://superuser.com/questions/154193/setting-a-users-home-directory-on-mac-os-x-server-from-the-command-line

Basically, use the dscl command line tool to see what the system thinks your home directory is set to, or to try and reset it....

Kendall Helmstetter Gelner
  • 74,769
  • 26
  • 128
  • 150