1
0
Fork 0
mirror of https://github.com/tldr-pages/tldr.git synced 2025-04-22 09:02:08 +02:00

useradd, userdel, usermod: highlighting both long and short options (#14338)

This commit is contained in:
Jakub Boukal 2024-10-23 18:57:11 +02:00 committed by GitHub
parent 50c1dc45f5
commit 8fa01fd44d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 13 additions and 13 deletions

View file

@ -10,24 +10,24 @@
- Create a new user with the specified user ID:
`sudo useradd --uid {{id}} {{username}}`
`sudo useradd {{-u|--uid}} {{id}} {{username}}`
- Create a new user with the specified shell:
`sudo useradd --shell {{path/to/shell}} {{username}}`
`sudo useradd {{-s|--shell}} {{path/to/shell}} {{username}}`
- Create a new user belonging to additional groups (mind the lack of whitespace):
`sudo useradd --groups {{group1,group2,...}} {{username}}`
`sudo useradd {{-G|--groups}} {{group1,group2,...}} {{username}}`
- Create a new user with the default home directory:
`sudo useradd --create-home {{username}}`
`sudo useradd {{-m|--create-home}} {{username}}`
- Create a new user with the home directory filled by template directory files:
`sudo useradd --skel {{path/to/template_directory}} --create-home {{username}}`
`sudo useradd {{-k|--skel}} {{path/to/template_directory}} {{-m|--create-home}} {{username}}`
- Create a new system user without the home directory:
`sudo useradd --system {{username}}`
`sudo useradd {{-r|--system}} {{username}}`

View file

@ -10,8 +10,8 @@
- Remove a user in other root directory:
`sudo userdel --root {{path/to/other/root}} {{username}}`
`sudo userdel {{-R|--root}} {{path/to/other/root}} {{username}}`
- Remove a user along with the home directory and mail spool:
`sudo userdel --remove {{username}}`
`sudo userdel {{-r|--remove}} {{username}}`

View file

@ -6,20 +6,20 @@
- Change a username:
`sudo usermod --login {{new_username}} {{username}}`
`sudo usermod {{-l|--login}} {{new_username}} {{username}}`
- Change a user ID:
`sudo usermod --uid {{id}} {{username}}`
`sudo usermod {{-u|--uid}} {{id}} {{username}}`
- Change a user shell:
`sudo usermod --shell {{path/to/shell}} {{username}}`
`sudo usermod {{-s|--shell}} {{path/to/shell}} {{username}}`
- Add a user to supplementary groups (mind the lack of whitespace):
`sudo usermod --append --groups {{group1,group2,...}} {{username}}`
`sudo usermod {{-a|--append}} {{-G|--groups}} {{group1,group2,...}} {{username}}`
- Change a user home directory:
`sudo usermod --move-home --home {{path/to/new_home}} {{username}}`
`sudo usermod {{-m|--move-home}} {{-d|--home}} {{path/to/new_home}} {{username}}`