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.

Does anyone know how I might change my home directory in the shell please?

share|improve this question
add comment

3 Answers

up vote 45 down vote accepted

Running

sudo usermod -d /path/to/new/home -m *username*

will copy all files from your current home directory to /path/to/new/home and will also update the system file that stores the location of your home directory (/etc/passwd).

share|improve this answer
    
Worked for me in Ubuntu 12.04, thanks –  HappyDeveloper Jul 4 '12 at 3:19
add comment

http://ubuntuforums.org/showthread.php?t=46866

this is a nice How-To on home-dir moving. I Have not tried this myself, but it looks rather complicated.

Nick

share|improve this answer
    
It's not as complicated as it looks, they just had to explain in detail for people who aren't familiar with the process. All it really involves is (1) create partition, if necessary (2) mount partition (3) copy files (3) unmount partition (4) edit /etc/fstab (5) move old home directory out of the way (6) move new home directory to /home (7) mount new /home (8) check everything, and remove old home directory –  David Z Sep 13 '09 at 12:33
add comment

I have not tried this, but I think you can change it in /etc/passwd.

share|improve this answer
add comment

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.