linux命令之whoami
1.whoami介绍
linux命令whoami是用来显示当前会用用户名称
2.whoami用法
whoami [参数]
| 参数 | 说明 |
| --help | 显示帮助信息 |
| --version | 显示版本信息 |
3.实例
3.1.显示帮助信息
命令:
whoami --help
[root@rhel77 ~]# whoami --help Usage: whoami [OPTION]... Print the user name associated with the current effective user ID. Same as id -un. --help display this help and exit --version output version information and exit GNU coreutils online help: <http://www.gnu.org/software/coreutils/> For complete documentation, run: info coreutils 'whoami invocation' [root@rhel77 ~]#
讯享网
3.2.显示版本信息
命令:
whoami --version
讯享网[root@rhel77 ~]# whoami --version
whoami (GNU coreutils) 8.22
Copyright (C) 2013 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Written by Richard Mlynarik.
[root@rhel77 ~]#
3.3.显示当前会话用户名称
命令:
whoami
[root@rhel77 ~]# whoami root [root@rhel77 ~]#
等价于
id -un
讯享网[root@rhel77 ~]# id -un root [root@rhel77 ~]#

版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容,请联系我们,一经查实,本站将立刻删除。
如需转载请保留出处:https://51itzy.com/kjqy/107875.html