Linux command
users 命令
文本
复制后可按需替换文件名、目录或参数。
常用示例
Show logged in users
users
From specific file
users [/var/log/wtmp]
说明
users prints a compact, space-separated list of usernames currently logged into the system. If a user has multiple login sessions, their name appears once for each session. The command reads from /var/run/utmp by default to determine who is logged in. An alternate utmp-format file can be specified as an argument, such as /var/log/wtmp to see historical logins. Unlike who and w, which provide detailed information about each session, users produces minimal output suitable for quick checks or scripting where only the list of logged-in usernames is needed.
参数
- --help
- Show help.
- --version
- Show version.
FAQ
What is the users command used for?
users prints a compact, space-separated list of usernames currently logged into the system. If a user has multiple login sessions, their name appears once for each session. The command reads from /var/run/utmp by default to determine who is logged in. An alternate utmp-format file can be specified as an argument, such as /var/log/wtmp to see historical logins. Unlike who and w, which provide detailed information about each session, users produces minimal output suitable for quick checks or scripting where only the list of logged-in usernames is needed.
How do I run a basic users example?
Run `users` in a terminal, then adjust file names, paths, flags, or remote targets for your system.
What does --help do in users?
Show help.