Linux命令(115)之whoami
  wwLZeziuqjLR 2023年11月19日 16 0

linux命令之whoami

1.whoami介绍

linux命令whoami是用来显示当前会用用户名称

2.whoami用法

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 ~]#



【版权声明】本文内容来自摩杜云社区用户原创、第三方投稿、转载,内容版权归原作者所有。本网站的目的在于传递更多信息,不拥有版权,亦不承担相应法律责任。如果您发现本社区中有涉嫌抄袭的内容,欢迎发送邮件进行举报,并提供相关证据,一经查实,本社区将立刻删除涉嫌侵权内容,举报邮箱: cloudbbs@moduyun.com

  1. 分享:
最后一次编辑于 2023年11月19日 0

暂无评论

推荐阅读
  wwLZeziuqjLR   2023年11月19日   17   0   0 用户名whoami
  L83A5jZvvg3Q   2023年11月19日   25   0   0 用户名可选值子树
  pfl0iGEgXbv6   2023年11月19日   20   0   0 git用户名bc
  lzKZp2NHpNSL   2023年11月13日   29   0   0 用户名linux启动服务