How Do I Set the Home Path in Linux?

How Do I Set the Home Path in Linux?
Contents

How do I set the 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 find my home path in Linux?

To find the home directory for user FOO on a UNIX-ish system, use ~FOO . For the current user, use ~ . The userdir prefix (e.g., ‘/home’ or ‘/export/home’) could be a configuration item. Then the app can append the arbitrary user name to that path.

James H. Sterling
Author

James H. Sterling

James Sterling reports on renewable energy developments, climate policy, ecological conservation, and green tech innovations around the globe.