How Do I Change javaHome in Linux?
Contents

How do I change the default home directory in Linux?

You can use the usermod command to change the default home directory for a user. What this command does is edit the file /etc/passwd. Opening /etc/passwd you will find there is a line for every user, including system users (mysql, posftix, etc), with seven fields per line denoted by colons.

How do I change my user’s home directory?

Change the user’s home directory:

usermod is the command to edit an existing user. -d (abbreviation for —home ) will change the user’s home directory.

David Miller

David Miller

Executive Financial & Market Analyst

David Miller brings 15 years of experience in global economics, personal finance strategy, and market dynamics. He specializes in turning complex economic trends into actionable insights for everyday readers.

Share this article
Twitter Facebook Pinterest