1、id命令用於反饋用於ID,所屬組ID,(所屬組名 ?)
使用root測試結果:
[root@linuxprobe home]# whoami ## root用戶 root [root@linuxprobe home]# echo $USER root [root@linuxprobe home]# id root ## 測試root賬戶,可以正常反饋 uid=0(root) gid=0(root) groups=0(root) [root@linuxprobe home]# id linuxprobe ## 測試普通用戶,可以正常反饋 uid=1000(linuxprobe) gid=1000(linuxprobe) groups=1000(linuxprobe) [root@linuxprobe home]# id xxxxx ## 測試不存在的賬戶 id: ‘xxxxx’: no such user
2、使用普通用戶測試
[linuxprobe@linuxprobe home]$ whoami ## 測試結果同上 linuxprobe [linuxprobe@linuxprobe home]$ echo $USER linuxprobe [linuxprobe@linuxprobe home]$ id root uid=0(root) gid=0(root) groups=0(root) [linuxprobe@linuxprobe home]$ id linuxprobe uid=1000(linuxprobe) gid=1000(linuxprobe) groups=1000(linuxprobe) [linuxprobe@linuxprobe home]$ id yyyy id: ‘yyyy’: no such user