Let's review the previous section:
1. Set Password command passwd
2. User Information Modification Command usermod
3. User Delete command Userdel
4. Job: Modify User1 User ID 505, home directory to admin, user Group is admin, finally delete user1 user
Usermod–u 505–d/home/admin–g Admin User1
Userdel user1
In this section, we continue to talk about user management-related commands
1. Add User group Groupadd
The use of this command is simple groupadd groupname
After the addition is complete, you can view the group information in the/etc/group file
You can see that the ID of group1 is 1001, and we can specify the-G parameter to specify the ID of the group
Let's say we create a new group2 group with ID 501.
GROUPADD–G 501 Group2
View in/etc/group
2. Modify User Group Groupmod command
This command allows you to modify the ID and name of the group, using the-G and-N parameters respectively
For example, we want to change the ID of group1 to 502, the name is Group3
Groupmod–g 502–n Group3 group1
View Results
3. Delete user group Groupdel
The application is simple, you can delete the specified group by specifying the group name, such as deleting the group2 group
Groupdel group2
View group information and discover that group2 does not exist.
More articles please pay attention to the public number "kick genius"
Linux System Command Learning Series-User group management