theshell.ch/site/pages/cmd/interm/Who.html

49 lines
1.5 KiB
HTML
Raw Normal View History

---
layout: page
category_title: Intermediate commands
category-page: intermediate
author: Marco Farace
title: Who/WhoamI
---
<h2>Use: display a list of all logged in users/display info about current user</h2>
<p>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
hostname if not local. </p>
<p>
Here are just some of the most useful options for this command:
<ul>
<li>-b</li><br> Display time of last system boot.
<li> -d</li><br> Print dead processes.
<li>-H</li><br> Write column headings above the regular output.
<li>-m</li><br> Only print information about the current terminal. This is the
POSIX way of saying who am i.
<li>-q</li><br> ``Quick mode'': List only the names and the number of users cur-
rently logged on. When this option is used, all other options are
ignored.
<li>-s</li><br> List only the name, line and time fields. This is the default.
<li>-T</li><br> Print a character after the user name indicating the state of the
terminal line: `+' if the terminal is writable; `-' if it is not;
and `?' if a bad line is encountered.
<li>-u</li><br> Print the idle time for each user, and the associated process ID.
<li>am I</li><br> Returns the invoker's real user name.
<li>file</li><br> By default, who gathers information from the file /var/run/utmpx.
An alternative file may be specified.
<ul>
</p>