Can I change my home directory location?

QuestionsQuestions8 SkillsProUser Account ManagementSep, 20 2025
0108

Yes, you can change your home directory location using the usermod command in Linux. Here’s how you can do it:

  1. Open a terminal.

  2. Run the following command, replacing /new/home/directory with the desired path and username with your actual username:

    sudo usermod -d /new/home/directory username
  3. To verify the change, you can check the /etc/passwd file with:

    sudo grep -w 'username' /etc/passwd

This will show you the updated home directory for the specified user. Make sure to move any existing files from the old home directory to the new one if necessary.

0 Comments

no data
Be the first to share your comment!