In Linux, all users under a user group are searched online, and many copy articles are displayed. groups displays the user group of the currently logged-on user, and there is no user list of this user group. In practice, you can use the following method to view all users in a user group: information about groups in the system is stored in the/etc/group file, put user information in the/etc/passwd file. Now I want to view all users in a group named "Plants. First, you must know the group id, that is, gid. Run the command: grep 'plants'/etc/group www.2cto.com and the result is: Plants: x: 1003 indicates that gid is 1003 (this group is 1003 on my computer, other computers may also be other numbers ). Then, in/etc/passwd, find the user whose group number is 1003. You can check this file with cat/etc/passwd and find that the fourth column is gid (separated ). Next, enter: awk-F ":" '{print $1 "\ t" $4}'/etc/passwd | grep '000000' ": ":" is used as the separator (":" is used as the Separator in/etc/passwd); print; $1 and $4 represent the first and fourth columns, respectively, and username and group number; \ t indicates a tab; grep '123456' indicates that 1003 rows are taken out. In this way, all users in a group can be displayed.