root@bt:~/test# who --help
Usage: who [OPTION]... [ FILE | ARG1 ARG2 ]
Print information about users who are currently logged in.
-a, --all same as -b -d --login -p -r -t -T -u
-b, --boot time of last system boot
-d, --dead print dead processes
-H, --heading print line of column headings
--ips print ips instead of hostnames. with --lookup,
canonicalizes based on stored IP, if available,
rather than stored hostname
-l, --login print system login processes
--lookup attempt to canonicalize hostnames via DNS
-m only hostname and user associated with stdin
-p, --process print active processes spawned by init
-q, --count all login names and number of users logged on
-r, --runlevel print current runlevel
-s, --short print only name, line, and time (default)
-t, --time print last system clock change
-T, -w, --mesg add user's message status as +, - or ?
-u, --users list users logged in
--message same as -T
--writable same as -T
--help display this help and exit
--version output version information and exit
root@bt:~/test# whoami
root
root@bt:~/test# id
uid=0(root) gid=0(root) groups=0(root)
root@bt:~/test#
Linux who 命令详解
本文详细介绍了 Linux 系统中 who 命令的使用方法及其各种选项的功能,包括显示当前登录用户的信息、系统启动时间等。通过具体实例展示了如何利用 who 命令获取系统状态。
1269

被折叠的 条评论
为什么被折叠?



