How Do I Change the Default Directory in Linux?
Contents

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.

How do I change the default home directory in Linux?

You need to edit the /etc/passwd file to change home directory of users that are currently logged in. Edit the /etc/passwd with sudo vipw and change home directory of the user. vipw highly recommended other than vim or other editors since vipw will set lock to prevent any data corruption.

How do you change directories in Linux?

The chown command allows you to change the user and/or group ownership of a given file, directory, or symbolic link. In Linux, all files are associated with an owner and a group and assigned with permission access rights for the file owner, the group members, and others.

Robert Thorne

Robert Thorne

Automotive & Future Transportation Editor

Robert Thorne covers electric vehicle innovations, autonomous driving systems, global mobility trends, and automotive engineering developments.

Share this article
Twitter Facebook Pinterest