Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Somehow my home directory on my Mac has been changed and I'm not sure how to go about changing it back, I'm more of a linux guy and Mac OS X has some other mechanism for storing that information.

Basically when I log into the machine normally than start a terminal window. I start in the /Users/erik_miller directory, which is my home directory, but when I run some this like

cd ~

The machine tries to change to

/Users/erik_miller.

Yes, the same path with a period on the end. I can change my $HOME environment variable for the session, but the next time I start the machine it reverts. So, I think if I can find where that information is stored I can just change it there and hopefully all will be well.

share|improve this question
    
what happens (before you change it obviously) if you type echo $HOME ? you might need to go in to the mac user settings... –  Brian Postow Apr 13 '10 at 14:08

2 Answers 2

In the Accounts section of the System Prefs, right click (ctl) on your name it give you the option of "Advanced settings" one of the advanced settings is Home Directory... if that has the period in it, delete it. You may need to log out and back in again...

share|improve this answer
    
Yeah, checked the advanced options settings and they point to the correct home directory. Any other ideas? –  Erik Miller Apr 13 '10 at 14:40
    
Does the home button in finder work correctly? I expect that it does. Likewise, I expect that $HOME initially has the period... you may have to poke around in the passwd file or the mac dscl equivalent... dscl is nasty, but it does eventually let you get stuff done... –  Brian Postow Apr 13 '10 at 16:00
    
It only seems to be occurring in the command line. As far as finder and all the gui applications go, my home directory is correct. –  Erik Miller Apr 13 '10 at 17:38

Check Directory Utility to find out where it is looking for user information.

In System Preferences » Accounts » Login Options, press Join... or Edit, then Open Directory Utility...

In the Services tab, if Active Directory is enabled, check the Advanced Options under User Experience and the homeDirectory attribute in Active Directory. If NIS is enabled and you have an NIS server on your network check the NIS passwd map (ypmatch erik_miller passwd). If LDAP is enabled check the homeDirectory attribute in LDAP. Directory Services can be checked using the dscl command (e.g. dscl . -read /Users/erik_miller for the local domain). You might also check /etc/passwd although this is not normally used if Directory Services is available.

Also, since you say that it is only a problem on the command line, you might check your login scripts (e.g. .bashrc, .profile, .login, .cshrc, .tcshrc, etc., depending on your shell) to ensure that none of them are modifying HOME.

share|improve this answer
    
checked out the setting for both of those utilities. The first, ypmatch, did not return any matches, doesn't look like it's being used. The second returned a bunch of information including the correct home directory. –  Erik Miller Apr 13 '10 at 17:37
    
Since you say that it is only a problem on the command line, you might check your login scripts in case they are modifying HOME. –  mark4o Apr 13 '10 at 19:14
1  
Found it, my .profile file has HOME defined and contained a '.' at the end. Thanks for the help –  Erik Miller Apr 13 '10 at 21:26

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.