List current users, their terminals, login times, and remote sources.
Do not display their current commands.
Which command is appropriate?
who lists current login sessions from utmp-style data, including terminal and login time.
Detailed explanation
lastIncorrect. last displays historical login and logout records.
whoCorrect. who lists current sessions with the requested details.
idIncorrect. id displays UID and group identity.
usersIncorrect. users lists names but omits the requested details.
Try it yourself
An example you can run in a temporary verification environment.
who 2>/dev/null | sed -n '1,3p'; printf '%s
' 'who reads current login sessions'Expected result
login中ならsession行、続いて確認文字列Key points
- who shows current sessions
- last shows history
- users is a short form
Notes
- Environment: GNU coreutils who / 読み取り専用
- Command output formatting can vary slightly by distribution or tool version.
- Run the example in a temporary directory or process when possible.
Foundation review
Permission bit
A mode bit controlling read, write, execute, or special execution behavior.
Account state
Attributes that determine whether a password or login account can be used.
Resource limit
A per-process or per-user ceiling such as open files or process count.