Options (9)
-l, --loginbooleanChange a username
Example:
sudo usermod {{[-l|--login]}} {{new_username}} {{username}}-u, --uidbooleanChange a user ID
Example:
sudo usermod {{[-u|--uid]}} {{id}} {{username}}-s, --shellbooleanChange a user shell
Example:
sudo usermod {{[-s|--shell]}} {{path/to/shell}} {{username}}booleanAdd a user to supplementary groups (mind the lack of whitespace)
Example:
sudo usermod {{[-aG|--append --groups]}} {{group1,group2,...}} {{username}}booleanRemove a user from specific groups
Example:
sudo usermod {{[-rG|--remove --groups]}} {{group1,group2,...}} {{username}}-m, --move-homebooleanChange a user home directory
Example:
sudo usermod {{[-m|--move-home]}} {{[-d|--home]}} {{path/to/new_home}} {{username}}-d, --homebooleanChange a user home directory
Example:
sudo usermod {{[-m|--move-home]}} {{[-d|--home]}} {{path/to/new_home}} {{username}}-L, --lockbooleanLock an account
Example:
sudo usermod {{[-L|--lock]}} {{username}}-U, --unlockbooleanUnlock an account
Example:
sudo usermod {{[-U|--unlock]}} {{username}}Examples (8)
Add a user to supplementary groups (mind the lack of whitespace)
made by @shridhargupta | data from tldr-pages