Linux命令(115)之whoami

linux命令之whoami

1.whoami介绍

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

2.whoami用法

whoami [参数]

|-----------|--------|
| 参数 | 说明 |
| --help | 显示帮助信息 |
| --version | 显示版本信息 |
[whoami参数]

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 ~]# 
相关推荐
j_xxx404_9 分钟前
Linux:文件描述符fd
linux·运维·服务器
未既9 分钟前
逻辑卷挂载磁盘操作命令
linux·运维·服务器
那就回到过去42 分钟前
拥塞管理和拥塞避免
运维·服务器·网络·网络协议·tcp/ip·ensp
李斯维1 小时前
安装 Arch Linux 到 VMware Workstation 的完全指南
linux
未来之窗软件服务1 小时前
服务器运维(三十六)日志分析nginx日志工具—东方仙盟
运维·服务器·服务器运维·仙盟创梦ide·东方仙盟
香蕉你个不拿拿^2 小时前
Linux粘滞位和文件,目录权限
linux·运维·服务器
木子欢儿2 小时前
Debian挂载飞牛OS创建的RAID分区和Btrfs分区指南
运维·debian
2401_858286112 小时前
OS52.【Linux】System V 共享内存(1)
linux·运维·服务器·共享内存
智能零售小白白3 小时前
零售会员营销自动化:标签体系与精准触达的技术实现
运维·自动化·零售
wbs_scy3 小时前
Linux 实战:从零实现动态进度条(含缓冲区原理与多版本优化)
linux·运维·服务器