不常用但容易忘记的,备注下~
1、查看当前用户
$ whoami
# print: user name, like "jessehu".
2、查看当前用户所属用户组信息
$ groups
# print: User's group name list, like "staff access_bpf everyone localaccounts"
3、查看指定用户的所属用户组
$ groups username
# print: the username's group name
4、查看指定用户所属用户组的详细信息(包含group id)
$ id -a username
# print: User's group name & id list, like "uid=501(jessehu) gid=20(staff) groups=20(staff),501(access_bpf),12(everyone),61(localaccounts)"