打印指定用戶所在組的名稱。
groups [OPTION]... [username]...
--help 顯示幫助信息并退出。
--version 顯示版本信息并退出。
username(可選):可以是一到多個(gè),不提供時(shí)默認(rèn)為當(dāng)前用戶。
返回0表示成功,返回非0值表示失敗。
顯示linux用戶所屬的組
[root@localhost ~]# groups linux
linux : linux adm dialout cdrom plugdev lpadmin admin sambashare
id -Gn。/etc/passwd中指定的一個(gè)組和在/etc/group中指定的其他組。GNU coreutils包中的命令,相關(guān)的幫助信息請查看man -s 1 groups,info coreutils 'groups invocation'。