xref: /freebsd/usr.bin/w/w.1 (revision bdcbfde31e8e9b343f113a1956384bdf30d1ed62)
19b50d902SRodney W. Grimes.\" Copyright (c) 1980, 1990, 1991, 1993
29b50d902SRodney W. Grimes.\"	The Regents of the University of California.  All rights reserved.
39b50d902SRodney W. Grimes.\"
49b50d902SRodney W. Grimes.\" Redistribution and use in source and binary forms, with or without
59b50d902SRodney W. Grimes.\" modification, are permitted provided that the following conditions
69b50d902SRodney W. Grimes.\" are met:
79b50d902SRodney W. Grimes.\" 1. Redistributions of source code must retain the above copyright
89b50d902SRodney W. Grimes.\"    notice, this list of conditions and the following disclaimer.
99b50d902SRodney W. Grimes.\" 2. Redistributions in binary form must reproduce the above copyright
109b50d902SRodney W. Grimes.\"    notice, this list of conditions and the following disclaimer in the
119b50d902SRodney W. Grimes.\"    documentation and/or other materials provided with the distribution.
12fbbd9655SWarner Losh.\" 3. Neither the name of the University nor the names of its contributors
139b50d902SRodney W. Grimes.\"    may be used to endorse or promote products derived from this software
149b50d902SRodney W. Grimes.\"    without specific prior written permission.
159b50d902SRodney W. Grimes.\"
169b50d902SRodney W. Grimes.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
179b50d902SRodney W. Grimes.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
189b50d902SRodney W. Grimes.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
199b50d902SRodney W. Grimes.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
209b50d902SRodney W. Grimes.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
219b50d902SRodney W. Grimes.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
229b50d902SRodney W. Grimes.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
239b50d902SRodney W. Grimes.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
249b50d902SRodney W. Grimes.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
259b50d902SRodney W. Grimes.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
269b50d902SRodney W. Grimes.\" SUCH DAMAGE.
279b50d902SRodney W. Grimes.\"
28*3f8c71d1SFernando Apesteguía.Dd August 24, 2020
299b50d902SRodney W. Grimes.Dt W 1
3062500372SRuslan Ermilov.Os
319b50d902SRodney W. Grimes.Sh NAME
329b50d902SRodney W. Grimes.Nm w
33a76f1729SSteve Price.Nd "display who is logged in and what they are doing"
349b50d902SRodney W. Grimes.Sh SYNOPSIS
358fe908efSRuslan Ermilov.Nm
36d6112c71SMarcel Moolenaar.Op Fl -libxo
377860b557SAndrey A. Chernov.Op Fl dhin
389b50d902SRodney W. Grimes.Op Fl M Ar core
399b50d902SRodney W. Grimes.Op Fl N Ar system
40ac3cd520SBrian Feldman.Op Ar user ...
419b50d902SRodney W. Grimes.Sh DESCRIPTION
429b50d902SRodney W. GrimesThe
4390389da9SPhilippe Charnier.Nm
449b50d902SRodney W. Grimesutility prints a summary of the current activity on the system,
459b50d902SRodney W. Grimesincluding what each user is doing.
469b50d902SRodney W. GrimesThe first line displays the current time of day, how long the system has
479b50d902SRodney W. Grimesbeen running, the number of users logged into the system, and the load
489b50d902SRodney W. Grimesaverages.
499b50d902SRodney W. GrimesThe load average numbers give the number of jobs in the run queue averaged
509b50d902SRodney W. Grimesover 1, 5 and 15 minutes.
519b50d902SRodney W. Grimes.Pp
529b50d902SRodney W. GrimesThe fields output are the user's login name, the name of the terminal the
539b50d902SRodney W. Grimesuser is on, the host from which the user is logged in, the time the user
549b50d902SRodney W. Grimeslogged on, the time since the user last typed anything,
559b50d902SRodney W. Grimesand the name and arguments of the current process.
569b50d902SRodney W. Grimes.Pp
579b50d902SRodney W. GrimesThe options are as follows:
5889273e7bSRuslan Ermilov.Bl -tag -width indent
5906691045SCraig Rodrigues.It Fl -libxo
6006691045SCraig RodriguesGenerate output via
6106691045SCraig Rodrigues.Xr libxo 3
6206691045SCraig Rodriguesin a selection of different human and machine readable formats.
6306691045SCraig RodriguesSee
6406691045SCraig Rodrigues.Xr xo_parse_args 3
6506691045SCraig Rodriguesfor details on command line arguments.
667860b557SAndrey A. Chernov.It Fl d
677860b557SAndrey A. Chernovdumps out the entire process list on a per controlling
687860b557SAndrey A. Chernovtty basis, instead of just the top level process.
699b50d902SRodney W. Grimes.It Fl h
709b50d902SRodney W. GrimesSuppress the heading.
719b50d902SRodney W. Grimes.It Fl i
729b50d902SRodney W. GrimesOutput is sorted by idle time.
739b50d902SRodney W. Grimes.It Fl M
749b50d902SRodney W. GrimesExtract values associated with the name list from the specified
759b50d902SRodney W. Grimescore instead of the default
7689273e7bSRuslan Ermilov.Pa /dev/kmem .
779b50d902SRodney W. Grimes.It Fl N
789b50d902SRodney W. GrimesExtract the name list from the specified system instead of the
799b50d902SRodney W. Grimesdefault
8089273e7bSRuslan Ermilov.Pa /boot/kernel/kernel .
819b50d902SRodney W. Grimes.It Fl n
820227791bSRuslan ErmilovDo not attempt to resolve network addresses (normally
8390389da9SPhilippe Charnier.Nm
845b718312SBrian Somersinterprets addresses and attempts to display them as names).
852279a9a4SHajimu UMEMOTOWhen
862279a9a4SHajimu UMEMOTO.Fl n
872279a9a4SHajimu UMEMOTOis specified more than once, hostnames stored in utmp are attempted to
882279a9a4SHajimu UMEMOTOresolve to display them as network addresses.
899b50d902SRodney W. Grimes.El
909b50d902SRodney W. Grimes.Pp
91ac3cd520SBrian FeldmanIf one or more
929b50d902SRodney W. Grimes.Ar user
93ac3cd520SBrian Feldmannames are specified, the output is restricted to those users.
949b50d902SRodney W. Grimes.Sh FILES
950806dd92SEd Schouten.Bl -tag -width ".Pa /var/run/utx.active" -compact
960806dd92SEd Schouten.It Pa /var/run/utx.active
979b50d902SRodney W. Grimeslist of users on the system
989b50d902SRodney W. Grimes.El
99*3f8c71d1SFernando Apesteguía.Sh EXAMPLES
100*3f8c71d1SFernando ApesteguíaShow global activity of the system:
101*3f8c71d1SFernando Apesteguía.Bd -literal -offset indent
102*3f8c71d1SFernando Apesteguía$ w
103*3f8c71d1SFernando Apesteguía 8:05PM  up 35 mins, 3 users, load averages: 0.09, 0.35, 0.27
104*3f8c71d1SFernando ApesteguíaUSER       TTY      FROM            LOGIN@  IDLE WHAT
105*3f8c71d1SFernando Apesteguíafernape    v0       -               7:30PM     - tmux: client (/tmp/tmux-1001/default) (tmux)
106*3f8c71d1SFernando Apesteguíaroot       v1       -               8:03PM     1 -bash (bash)
107*3f8c71d1SFernando Apesteguíafernape    pts/0    tmux(1391).%0   8:04PM     - w
108*3f8c71d1SFernando Apesteguía.Ed
109*3f8c71d1SFernando Apesteguía.Pp
110*3f8c71d1SFernando ApesteguíaShow the entire process list per tty:
111*3f8c71d1SFernando Apesteguía.Bd -literal -offset indent
112*3f8c71d1SFernando Apesteguía$ w -d
113*3f8c71d1SFernando Apesteguía 8:12PM  up 42 mins, 3 users, load averages: 0.01, 0.11, 0.17
114*3f8c71d1SFernando ApesteguíaUSER       TTY      FROM            LOGIN@  IDLE WHAT
115*3f8c71d1SFernando Apesteguía                1199      login [pam] (login)
116*3f8c71d1SFernando Apesteguía                1207      -bash (bash)
117*3f8c71d1SFernando Apesteguía                1507      tmux: client (/tmp/tmux-1001/default) (tmux)
118*3f8c71d1SFernando Apesteguíafernape    v0       -               7:30PM     - tmux: client (/tmp/tmux-1001/default) (tmux)
119*3f8c71d1SFernando Apesteguía                1488      login [pam] (login)
120*3f8c71d1SFernando Apesteguía                1489      -bash (bash)
121*3f8c71d1SFernando Apesteguíaroot       v1       -               8:08PM     3 -bash (bash)
122*3f8c71d1SFernando Apesteguía                1510      -bash (bash)
123*3f8c71d1SFernando Apesteguía                1515      w -d
124*3f8c71d1SFernando Apesteguíafernape    pts/0    tmux(1509).%0   8:11PM     - w -d
125*3f8c71d1SFernando Apesteguía.Ed
126*3f8c71d1SFernando Apesteguía.Pp
127*3f8c71d1SFernando ApesteguíaSame as above but only for the root user and omitting the heading:
128*3f8c71d1SFernando Apesteguía.Bd -literal -offset indent
129*3f8c71d1SFernando Apesteguía$ w -d -h root
130*3f8c71d1SFernando Apesteguía		1183      login [pam] (login)
131*3f8c71d1SFernando Apesteguía		1204      -bash (bash)
132*3f8c71d1SFernando Apesteguíaroot       v1       -       7:15PM     - -bash (bash)
133*3f8c71d1SFernando Apesteguía.Ed
1346c7216dfSRuslan Ermilov.Sh COMPATIBILITY
1356c7216dfSRuslan ErmilovThe
1366c7216dfSRuslan Ermilov.Fl f ,
1376c7216dfSRuslan Ermilov.Fl l ,
1386c7216dfSRuslan Ermilov.Fl s ,
1396c7216dfSRuslan Ermilovand
1406c7216dfSRuslan Ermilov.Fl w
1416c7216dfSRuslan Ermilovflags are no longer supported.
1429b50d902SRodney W. Grimes.Sh SEE ALSO
1439b50d902SRodney W. Grimes.Xr finger 1 ,
1449b50d902SRodney W. Grimes.Xr ps 1 ,
145da1ff3cbSWolfram Schneider.Xr uptime 1 ,
146a01ced33SMarcel Moolenaar.Xr who 1 ,
147a01ced33SMarcel Moolenaar.Xr libxo 3 ,
148a01ced33SMarcel Moolenaar.Xr xo_parse_args 3
1496c7216dfSRuslan Ermilov.Sh HISTORY
1506c7216dfSRuslan ErmilovThe
1516c7216dfSRuslan Ermilov.Nm
1526c7216dfSRuslan Ermilovcommand appeared in
1536c7216dfSRuslan Ermilov.Bx 3.0 .
1549b50d902SRodney W. Grimes.Sh BUGS
1559b50d902SRodney W. GrimesThe notion of the
1569b50d902SRodney W. Grimes.Dq current process
1579b50d902SRodney W. Grimesis muddy.
15889273e7bSRuslan ErmilovThe current algorithm is
15989273e7bSRuslan Ermilov.Do
16089273e7bSRuslan Ermilovthe highest numbered process on the terminal
1619b50d902SRodney W. Grimesthat is not ignoring interrupts, or, if there is none, the highest numbered
16289273e7bSRuslan Ermilovprocess on the terminal
16389273e7bSRuslan Ermilov.Dc .
1649b50d902SRodney W. GrimesThis fails, for example, in critical sections of programs like the shell
1659b50d902SRodney W. Grimesand editor, or when faulty programs running in the background fork and fail
1669b50d902SRodney W. Grimesto ignore interrupts.
1679b50d902SRodney W. Grimes(In cases where no process can be found,
16890389da9SPhilippe Charnier.Nm
1699b50d902SRodney W. Grimesprints
17089273e7bSRuslan Ermilov.Ql \- . )
1719b50d902SRodney W. Grimes.Pp
172*3f8c71d1SFernando ApesteguíaThe CPU time is only an estimate, in particular, if someone leaves a background
1739b50d902SRodney W. Grimesprocess running after logging out, the person currently on that terminal is
1749b50d902SRodney W. Grimes.Dq charged
1759b50d902SRodney W. Grimeswith the time.
1769b50d902SRodney W. Grimes.Pp
1779b50d902SRodney W. GrimesBackground processes are not shown, even though they account for
1789b50d902SRodney W. Grimesmuch of the load on the system.
1799b50d902SRodney W. Grimes.Pp
1809b50d902SRodney W. GrimesSometimes processes, typically those in the background, are printed with
1819b50d902SRodney W. Grimesnull or garbaged arguments.
1829b50d902SRodney W. GrimesIn these cases, the name of the command is printed in parentheses.
1839b50d902SRodney W. Grimes.Pp
1849b50d902SRodney W. GrimesThe
18590389da9SPhilippe Charnier.Nm
1869b50d902SRodney W. Grimesutility does not know about the new conventions for detection of background
1879b50d902SRodney W. Grimesjobs.
1889b50d902SRodney W. GrimesIt will sometimes find a background job instead of the right one.
189