shell获取用户名和uid

来源:互联网 发布:南京软件开发有限公司 编辑:程序博客网 时间:2024/06/11 13:10
[user@localhost fix_bug_srpm]$ echo "$USER"user[user@localhost fix_bug_srpm]$ echo `id -u`503[user@localhost fix_bug_srpm]$ echo `whoami`user[user@localhost fix_bug_srpm]$ echo `who am i`user pts/1 2009-10-26 10:49 (:0.0)[user@localhost fix_bug_srpm]$ whouser     tty1         2009-10-26 09:29 (:0)user     pts/0        2009-10-26 10:43 (:0.0)user     pts/1        2009-10-26 10:49 (:0.0)#在使用终端[user@localhost fix_bug_srpm]$ echo "$UID"503注:都在env中
0 0
原创粉丝点击