Document and content processing - userdel, groupadd
1. userdel: Delete User
Userdel command function description
userdel
Command is used to delete user accounts.userdel
You can delete a user account and related files. Without additional parameters, only delete a user account without deleting the related files.Userdel command syntax
userdel
[Options] loginuserdel
[-r] [user account]Description of common parameters userdel command:
userdel
Small parameters in Table 1 for theuserdel
parameters and descriptions of commands:Table 1:
userdel
Parameters and descriptions of commands
Parameter options | explain |
---|---|
-r | User login directory and delete all the files in the directory. |
Userdel command of practical operation
Example 1: delete user accounts
userdel hnlinux
2. groupadd: Add User Group
Description groupadd command functions
groupmod
Command changes the group ID or name. When you need to change the identification code or name of the group, you cangroupmod
command to do the job.Groupadd command syntax
groupadd
[Option] Groupgroupmod
[-g <group ID> <-o>] [- n < new group name>] [Name Group]groupadd commands commonly used parameters Description:
groupadd
Small parameters in Table 1 for thegroupadd
parameters and descriptions of commands:Table 1:
groupadd
Parameters and descriptions of commands
Parameter options | explain |
---|---|
-g <Group ID> | To use the setting group identifier. |
-O | Reuse group ID. |
-n <new group name> | Set To use the group name. |
Hands-groupadd command
Example 1: Modify the group name
[root@test~]# groupadd linuxso
[root@test ~]# tail -1 /etc/group
linuxso:x:500:
[root@test ~]# tail -1 /etc/group
linuxso:x:500:
[root@test ~]# groupmod -n linux linuxso
[root@test ~]# tail -1 /etc/group
linux:x:500:
Today I write to you, have any questions or something goes wrong, feel free to enlighten the great God who comment