2018-11-12 12:46:51 +00:00
|
|
|
---
|
|
|
|
layout: page
|
|
|
|
category-page: intermediate
|
2018-11-16 12:47:48 +00:00
|
|
|
category-title: Intermediate commands
|
2018-11-12 12:46:51 +00:00
|
|
|
author: Marco Farace
|
|
|
|
title: who
|
|
|
|
---
|
|
|
|
The <code>who</code> command displays a list of all logged in users/display info
|
|
|
|
about current user
|
|
|
|
|
|
|
|
The who utility displays a list of all users currently logged on, showing
|
|
|
|
for each user the login name, tty name, the date and time of login, and
|
2018-11-15 20:09:21 +00:00
|
|
|
hostname if not local.<br>
|
2018-11-12 12:46:51 +00:00
|
|
|
|
|
|
|
<h3>Flags</h3>
|
|
|
|
Here are just some of the most useful options for this command:
|
|
|
|
|
|
|
|
<ul>
|
|
|
|
<li>-b: Display time of last system boot.</li>
|
|
|
|
<li> -d: Print dead processes.</li>
|
2018-11-15 20:09:21 +00:00
|
|
|
<li>-H: Write column headings above the regular output.</li>
|
2018-11-18 17:39:51 +00:00
|
|
|
<li>-m: Only print information about the current terminal.</li>
|
2018-11-15 20:09:21 +00:00
|
|
|
<li>-q: <i>Quick mode</i>: List only the names and the number of users currently logged on.
|
2018-11-12 12:46:51 +00:00
|
|
|
When this option is used, all other options are
|
2018-11-18 17:39:51 +00:00
|
|
|
ignored.
|
|
|
|
</li>
|
2018-11-15 20:09:21 +00:00
|
|
|
<li>-s: List only the name, line and time fields. This is the default.</li>
|
|
|
|
<li>-T: Print a character after the user name indicating the state of the
|
2018-11-12 12:46:51 +00:00
|
|
|
terminal line: "+" if the terminal is writable; "-" if it is not;
|
2018-11-18 17:39:51 +00:00
|
|
|
and "?" if a bad line is encountered.
|
|
|
|
</li>
|
2018-11-15 20:09:21 +00:00
|
|
|
<li>-u: Print the idle time for each user, and the associated process ID.</li>
|
|
|
|
<li>am I: Returns the invoker's real user name. You can also use <code>whoami</code></li>
|
|
|
|
<li>file: By default, who gathers information from the file /var/run/utmpx.
|
2018-11-18 17:39:51 +00:00
|
|
|
An alternative file may be specified.
|
|
|
|
</li>
|
2018-11-15 20:09:21 +00:00
|
|
|
</ul>
|