usermod

usermod

The usermod command is a Linux command that is used to modify the properties of a user account. It is a powerful tool that can be used to change the username, home directory, shell, and other properties of a user account.

The usermod command is used as follows:

usermod [options] username
  • options: These are optional flags that can be used to control the behavior of the usermod command.

  • username: This is the username of the user account that you want to modify.

For example, the following command will change the home directory of the user johndoe to /home/newhome:

usermod -d /home/newhome johndoe

The usermod command offers a variety of options that can be used to modify the properties of a user account. Here are some of the most common options:

  • -d: This option is used to change the home directory of the user account.

  • -m: This option is used to move the user's home directory to the new location.

  • -s: This option is used to change the shell of the user account.

  • -g: This option is used to change the primary group of the user account.

  • -G: This option is used to add the user account to additional groups.

The usermod command is a powerful tool that can be used to modify the properties of a user account. It is a valuable tool for system administrators who need to manage user accounts.

help

Last updated