如何在 Linux 上获取当前用户的主组 GID

运行

id_g_example.sh
id -g

以获取当前用户主组的 GID。示例:

id_g_output.txt
$ id -g
1000

你也可以获取其他用户主组的 GID:

id_g_root_output.txt
$ id -g root
0

Check out similar posts by category: Linux