Cause:
When using MacLinuxOperations on users and groups are the same, but gpasswd and usermod used in Linux are not available on Mac, and dscl is used on Mac to operate on group and user.
Introduction:
$ Man dscldscl (1) BSD General commands manual dscl (1) Name dscl -- directory service command line utilitydescription dscl is a general-purpose Utility for operating on directory service directory nodes. its commands allow one to create, read, and manage directory service data.
Method: visualization method:
System Preferences-> Users & groups and perform manual operations. However, not all users can be viewed here, for example, _ www.
Display the group corresponding to all users:
$ Sudo dscl.-list/groups groupmembership
Add User to group:
$ Sudo dscl.-append/groups/groupname groupmembership Username
Delete a user from a group:
$ Sudo dscl.-delete/groups/groupname groupmembership Username