build-sys: Rearrange the manual pages

All man pages are found in ./man
man-po -> po-man

References:
 https://www.freelists.org/post/procps/Next-for-newlib,3

Signed-off-by: Craig Small <csmall@dropbear.xyz>
This commit is contained in:
Craig Small
2022-08-29 18:07:43 +10:00
parent 5fcf104cba
commit 8e889ae682
38 changed files with 16944 additions and 16944 deletions

154
man/free.1 Normal file
View File

@@ -0,0 +1,154 @@
.\" -*-Nroff-*-
.\" This page Copyright (C) 1993 Matt Welsh, mdw@sunsite.unc.edu.
.\" Long options where added at April 15th, 2011.
.\" Freely distributable under the terms of the GPL
.TH FREE 1 "2022-06-25" "procps-ng" "User Commands"
.SH NAME
free \- Display amount of free and used memory in the system
.SH SYNOPSIS
.B free
.RI [ options ]
.SH DESCRIPTION
.B free
displays the total amount of free and used physical and swap memory in the
system, as well as the buffers and caches used by the kernel. The
information is gathered by parsing /proc/meminfo. The displayed
columns are:
.TP
\fBtotal\fR
Total installed memory (MemTotal and SwapTotal in /proc/meminfo)
.TP
\fBused\fR
Used or unavailable memory (calculated as \fBtotal\fR - \fBavailable\fR)
.TP
\fBfree\fR
Unused memory (MemFree and SwapFree in /proc/meminfo)
.TP
\fBshared\fR
Memory used (mostly) by tmpfs (Shmem in /proc/meminfo)
.TP
\fBbuffers\fR
Memory used by kernel buffers (Buffers in /proc/meminfo)
.TP
\fBcache\fR
Memory used by the page cache and slabs (Cached and SReclaimable in /proc/meminfo)
.TP
\fBbuff/cache\fR
Sum of \fBbuffers\fR and \fBcache\fR
.TP
\fBavailable\fR
Estimation of how much memory is available for starting
new applications, without swapping. Unlike the data
provided by the \fBcache\fR or \fBfree\fR fields,
this field takes into account page cache and also that
not all reclaimable memory slabs will be reclaimed
due to items being in use (MemAvailable in /proc/meminfo, available on
kernels 3.14, emulated on kernels 2.6.27+, otherwise the same as \fBfree\fR)
.SH OPTIONS
.TP
\fB\-b\fR, \fB\-\-bytes\fR
Display the amount of memory in bytes.
.TP
\fB\-k\fR, \fB\-\-kibi\fR
Display the amount of memory in kibibytes. This is the default.
.TP
\fB\-m\fR, \fB\-\-mebi\fR
Display the amount of memory in mebibytes.
.TP
\fB\-g\fR, \fB\-\-gibi\fR
Display the amount of memory in gibibytes.
.TP
\fB\-\-tebi\fR
Display the amount of memory in tebibytes.
.TP
\fB\-\-pebi\fR
Display the amount of memory in pebibytes.
.TP
\fB\-\-kilo\fR
Display the amount of memory in kilobytes. Implies --si.
.TP
\fB\-\-mega\fR
Display the amount of memory in megabytes. Implies --si.
.TP
\fB\-\-giga\fR
Display the amount of memory in gigabytes. Implies --si.
.TP
\fB\-\-tera\fR
Display the amount of memory in terabytes. Implies --si.
.TP
\fB\-\-peta\fR
Display the amount of memory in petabytes. Implies --si.
.TP
\fB\-h\fR, \fB\-\-human\fP
Show all output fields automatically scaled to shortest three digit unit and
display the units of print out. Following units are used.
.sp
.nf
B = bytes
Ki = kibibyte
Mi = mebibyte
Gi = gibibyte
Ti = tebibyte
Pi = pebibyte
.fi
.sp
If unit is missing, and you have exbibyte of RAM or swap, the number is in
tebibytes and columns might not be aligned with header.
.TP
\fB\-w\fR, \fB\-\-wide\fR
Switch to the wide mode. The wide mode produces lines longer
than 80 characters. In this mode \fBbuffers\fR and \fBcache\fR
are reported in two separate columns.
.TP
\fB\-c\fR, \fB\-\-count\fR \fIcount\fR
Display the result
.I count
times. Requires the
.B \-s
option.
.TP
\fB\-l\fR, \fB\-\-lohi\fR
Show detailed low and high memory statistics.
.TP
\fB\-s\fR, \fB\-\-seconds\fR \fIdelay\fR
Continuously display the result \fIdelay\fR seconds
apart. You may actually specify any floating point number for
\fIdelay\fR using either . or , for decimal point.
.BR usleep (3)
is used for microsecond resolution delay times.
.TP
\fB\-\-si\fR
Use kilo, mega, giga etc (power of 1000) instead of kibi, mebi, gibi (power
of 1024).
.TP
\fB\-t\fR, \fB\-\-total\fR
Display a line showing the column totals.
.TP
\fB\-v\fR, \fB\-\-committed\fR
Display a line showing the memory commit limit and amount of committed/uncommitted
memory. The \fBtotal\fR column on this line will display the memory commit
limit. This line is relevant if memory overcommit is disabled.
.TP
\fB\-\-help\fR
Print help.
.TP
\fB\-V\fR, \fB\-\-version\fR
Display version information.
.PD
.SH FILES
.TP
/proc/meminfo
memory information
.PD
.SH BUGS
The value for the \fBshared\fR column is not available from kernels before
2.6.32 and is displayed as zero.
.TP
Please send bug reports to
.UR procps@freelists.org
.UE
.SH "SEE ALSO"
.BR ps (1),
.BR slabtop (1),
.BR top "(1),
.BR vmstat (8).

106
man/kill.1 Normal file
View File

@@ -0,0 +1,106 @@
'\" t
.\" (The preceding line is a note to broken versions of man to tell
.\" them to pre-process this man page with tbl)
.\" Man page for kill.
.\" Licensed under version 2 of the GNU General Public License.
.\" Written by Albert Cahalan; converted to a man page by
.\" Michael K. Johnson
.TH KILL 1 "2021-05-18" "procps-ng" "User Commands"
.SH NAME
kill \- send a signal to a process
.SH SYNOPSIS
.B kill
[options] <pid> [...]
.SH DESCRIPTION
The default signal for kill is TERM. Use
.B \-l
or
.B \-L
to list available signals. Particularly useful signals include HUP,
INT, KILL, STOP, CONT, and 0. Alternate signals may be specified in
three ways:
.BR \-9 ", " \-SIGKILL
or
.BR \-KILL .
Negative PID values may be used to choose whole process groups; see
the PGID column in ps command output. A PID of
.B \-1
is special; it indicates all processes except the kill process itself
and init.
.SH OPTIONS
.TP
.B <pid> [...]
Send signal to every <pid> listed.
.TP
.B \-<signal>
.TQ
.B \-s <signal>
.TQ
.B \-\-signal <signal>
Specify the
.B signal
to be sent. The signal can be specified by using name or number.
The behavior of signals is explained in
.BR signal (7)
manual page.
.TP
\fB\-q\fR, \fB\-\-queue \fIvalue\fP
Use
.BR sigqueue(3)
rather than
.BR kill(2)
and the value argument is used to specify
an integer to be sent with the signal. If the receiving process has
installed a handler for this signal using the SA_SIGINFO flag to
.BR sigaction(2) ,
then it can obtain this data via the si_value field of the
siginfo_t structure.
.TP
\fB\-l\fR, \fB\-\-list\fR [\fIsignal\fR]
List signal names. This option has optional argument, which
will convert signal number to signal name, or other way round.
.TP
.BR \-L , \ \-\-table
List signal names in a nice table.
.TP
.PD
.SH NOTES
Your shell (command line interpreter) may have a built-in kill
command. You may need to run the command described here as /bin/kill
to solve the conflict.
.SH EXAMPLES
.TP
.B kill \-9 \-1
Kill all processes you can kill.
.TP
.B kill \-l 11
Translate number 11 into a signal name.
.TP
.B kill -L
List the available signal choices in a nice table.
.TP
.B kill 123 543 2341 3453
Send the default signal, SIGTERM, to all those processes.
.SH "SEE ALSO"
.BR kill (2),
.BR killall (1),
.BR nice (1),
.BR pkill (1),
.BR renice (1),
.BR signal (7),
.BR sigqueue (3),
.BR skill (1)
.SH STANDARDS
This command meets appropriate standards. The
.B \-L
flag is Linux-specific.
.SH AUTHOR
.UR albert@users.sf.net
Albert Cahalan
.UE
wrote kill in 1999 to replace a bsdutils one that was not standards
compliant. The util-linux one might also work correctly.
.SH "REPORTING BUGS"
Please send bug reports to
.UR procps@freelists.org
.UE

306
man/pgrep.1 Normal file
View File

@@ -0,0 +1,306 @@
.\"
.\" Copyright 2000 Kjetil Torgrim Homme
.\" 2017-2020 Craig Small
.\"
.\" This program is free software; you can redistribute it and/or modify
.\" it under the terms of the GNU General Public License as published by
.\" the Free Software Foundation; either version 2 of the License, or
.\" (at your option) any later version.
.\"
.TH PGREP "1" "2022-07-18" "procps-ng" "User Commands"
.SH NAME
pgrep, pkill, pidwait \- look up, signal, or wait for processes based on name and other attributes
.SH SYNOPSIS
.B pgrep
[options] pattern
.br
.B pkill
[options] pattern
.br
.B pidwait
[options] pattern
.SH DESCRIPTION
.B pgrep
looks through the currently running processes and lists the process IDs which
match the selection criteria to stdout. All the criteria have to match.
For example,
.IP
$ pgrep \-u root sshd
.PP
will only list the processes called
.B sshd
AND owned by
.BR root .
On the other hand,
.IP
$ pgrep \-u root,daemon
.PP
will list the processes owned by
.B root
OR
.BR daemon .
.PP
.B pkill
will send the specified signal (by default
.BR SIGTERM )
to each process instead of listing them on stdout.
.PP
.B pidwait
will wait for each process instead of listing them on stdout.
.SH OPTIONS
.TP
\fB\-\fR\fIsignal\fP
.TQ
\fB\-\-signal\fR \fIsignal\fR
Defines the signal to send to each matched process. Either the numeric or
the symbolic signal name can be used.
.RB ( pkill
only.)
.TP
\fB\-c\fR, \fB\-\-count\fR
Suppress normal output; instead print a count of matching processes. When
count does not match anything, e.g. returns zero, the command will return
non-zero value. Note that for pkill and pidwait, the count is the number of
matching processes, not the processes that were successfully signaled or waited
for.
.TP
\fB\-d\fR, \fB\-\-delimiter\fR \fIdelimiter\fP
Sets the string used to delimit each process ID in the output (by default a
newline).
.RB ( pgrep
only.)
.TP
\fB\-e\fR, \fB\-\-echo\fR
Display name and PID of the process being killed.
.RB ( pkill
only.)
.TP
\fB\-f\fR, \fB\-\-full\fR
The
.I pattern
is normally only matched against the process name. When
.B \-f
is set, the full command line is used.
.TP
\fB\-g\fR, \fB\-\-pgroup\fR \fIpgrp\fP,...
Only match processes in the process group IDs listed. Process group 0 is
translated into
.BR pgrep 's,
.BR pkill 's,
or
.BR pidwait 's
own process group.
.TP
\fB\-G\fR, \fB\-\-group\fR \fIgid\fP,...
Only match processes whose real group ID is listed. Either the numerical or
symbolical value may be used.
.TP
\fB\-i\fR, \fB\-\-ignore\-case\fR
Match processes case-insensitively.
.TP
\fB\-l\fR, \fB\-\-list\-name\fR
List the process name as well as the process ID.
.RB ( pgrep
only.)
.TP
\fB\-a\fR, \fB\-\-list\-full\fR
List the full command line as well as the process ID.
.RB ( pgrep
only.)
.TP
\fB\-n\fR, \fB\-\-newest\fR
Select only the newest (most recently started) of the matching processes.
.TP
\fB\-o\fR, \fB\-\-oldest\fR
Select only the oldest (least recently started) of the matching processes.
.TP
\fB\-O\fR, \fB\-\-older\fR \fIsecs\fP
Select processes older than secs.
.TP
\fB\-P\fR, \fB\-\-parent\fR \fIppid\fP,...
Only match processes whose parent process ID is listed.
.TP
\fB\-s\fR, \fB\-\-session\fR \fIsid\fP,...
Only match processes whose process session ID is listed. Session ID 0
is translated into
.BR pgrep 's,
.BR pkill 's,
or
.BR pidwait 's
own session ID.
.TP
\fB\-t\fR, \fB\-\-terminal\fR \fIterm\fP,...
Only match processes whose controlling terminal is listed. The terminal name
should be specified without the "/dev/" prefix.
.TP
\fB\-u\fR, \fB\-\-euid\fR \fIeuid\fP,...
Only match processes whose effective user ID is listed. Either the numerical
or symbolical value may be used.
.TP
\fB\-U\fR, \fB\-\-uid\fR \fIuid\fP,...
Only match processes whose real user ID is listed. Either the numerical or
symbolical value may be used.
.TP
\fB\-v\fR, \fB\-\-inverse\fR\fR
Negates the matching. This option is usually used in
.BR pgrep 's
or
.BR pidwait 's
context. In
.BR pkill 's
context the short option is disabled to avoid accidental usage of the option.
.TP
\fB\-w\fR, \fB\-\-lightweight\fR\fR
Shows all thread ids instead of pids in
.BR pgrep 's
or
.BR pidwait 's
context. In
.BR pkill 's
context this option is disabled.
.TP
\fB\-x\fR, \fB\-\-exact\fR\fR
Only match processes whose names (or command lines if \fB\-f\fR is specified)
.B exactly
match the
.IR pattern .
.TP
\fB\-F\fR, \fB\-\-pidfile\fR \fIfile\fR
Read \fIPID\fRs from \fIfile\fR. This option is more useful for
.BR pkill or pidwait
than
.BR pgrep .
.TP
\fB\-L\fR, \fB\-\-logpidfile\fR
Fail if pidfile (see \fB\-F\fR) not locked.
.TP
\fB\-r\fR, \fB\-\-runstates\fR \fID,R,S,Z,\fP...
Match only processes which match the process state.
.TP
\fB\-\-cgroup \fIname\fP,...
Match on provided control group (cgroup) v2 name. See
.BR cgroups (8)
.TP
\fB\-\-ns \fIpid\fP
Match processes that belong to the same namespaces. Required to run as
root to match processes from other users. See \fB\-\-nslist\fR for how to
limit which namespaces to match.
.TP
\fB\-\-nslist \fIname\fP,...
Match only the provided namespaces. Available namespaces:
ipc, mnt, net, pid, user,uts.
.TP
\fB\-q\fR, \fB\-\-queue \fIvalue\fP
Use
.BR sigqueue(3)
rather than
.BR kill(2)
and the value argument is used to specify
an integer to be sent with the signal. If the receiving process has
installed a handler for this signal using the SA_SIGINFO flag to
.BR sigaction(2)
, then it can obtain this data via the si_value field of the
siginfo_t structure.
.TP
\fB\-V\fR, \fB\-\-version\fR
Display version information and exit.
.TP
\fB\-h\fR, \fB\-\-help\fR
Display help and exit.
.PD
.SH OPERANDS
.TP
.I pattern
Specifies an Extended Regular Expression for matching against the process
names or command lines.
.SH EXAMPLES
Example 1: Find the process ID of the
.B named
daemon:
.IP
$ pgrep \-u root named
.PP
Example 2: Make
.B syslog
reread its configuration file:
.IP
$ pkill \-HUP syslogd
.PP
Example 3: Give detailed information on all
.B xterm
processes:
.IP
$ ps \-fp $(pgrep \-d, \-x xterm)
.PP
Example 4: Make all
.B chrome
processes run nicer:
.IP
$ renice +4 $(pgrep chrome)
.SH "EXIT STATUS"
.PD 0
.TP
0
One or more processes matched the criteria. For pkill and pidwait, one or more
processes must also have been successfully signalled or waited for.
.TP
1
No processes matched or none of them could be signalled.
.TP
2
Syntax error in the command line.
.TP
3
Fatal error: out of memory etc.
.PD
.SH NOTES
The process name used for matching is limited to the 15 characters present in
the output of /proc/\fIpid\fP/stat. Use the \fB\-f\fR option to match against the
complete command line, /proc/\fIpid\fP/cmdline. Threads may not have the
same process name as the parent process but will have the same command line.
.PP
The running
.BR pgrep ,
.BR pkill ,
or
.B pidwait
process will never report itself as a
match.
.PP
The
.B \-O \-\-older
option will silently fail if /proc is mounted with the \fIsubset=pid\fR option.
.SH BUGS
The options
.B \-n
and
.B \-o
and
.B \-v
can not be combined. Let
me know if you need to do this.
.PP
Defunct processes are reported.
.PP
.B pidwait
requires the
.BR pidfd_open (2)
system call which first appeared in Linux 5.3.
.SH "SEE ALSO"
.BR ps (1),
.BR regex (7),
.BR signal (7),
.BR sigqueue (3),
.BR killall (1),
.BR skill (1),
.BR kill (1),
.BR kill (2),
.BR cgroups (8)
.SH AUTHOR
.UR kjetilho@ifi.uio.no
Kjetil Torgrim Homme
.UE
.SH "REPORTING BUGS"
Please send bug reports to
.UR procps@freelists.org
.UE

82
man/pidof.1 Normal file
View File

@@ -0,0 +1,82 @@
'\" -*- coding: UTF-8 -*-
.\" Copyright (C) 1998 Miquel van Smoorenburg.
.\"
.\" This program is free software; you can redistribute it and/or modify
.\" it under the terms of the GNU General Public License as published by
.\" the Free Software Foundation; either version 2 of the License, or
.\" (at your option) any later version.
.\"
.\" This program is distributed in the hope that it will be useful,
.\" but WITHOUT ANY WARRANTY; without even the implied warranty of
.\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
.\" GNU General Public License for more details.
.\"
.\" You should have received a copy of the GNU General Public License
.\" along with this program; if not, write to the Free Software
.\" Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
.\"
.TH PIDOF 1 "2020-12-22" "" "User Commands"
.SH NAME
pidof -- find the process ID of a running program
.SH SYNOPSIS
.B pidof
.RB [ \-s ]
.RB [ \-c ]
.RB [ \-q ]
.RB [ \-w ]
.RB [ \-x ]
.RB [ \-o
.IR omitpid[,omitpid...]... ]
.RB [ \-S
.IR separator ]
.B program
.RB [ program... ]
.SH DESCRIPTION
.B Pidof
finds the process id's (pids) of the named programs. It prints those
id's on the standard output.
.SH OPTIONS
.IP \-s
Single shot - this instructs the program to only return one \fIpid\fP.
.IP \-c
Only return process ids that are running with the same root directory.
This option is ignored for non-root users, as they will be unable to check
the current root directory of processes they do not own.
.IP \-q
Quiet mode, suppress any output and only sets the exit status accordingly.
.IP \-w
Show also processes that do not have visible command line (e.g. kernel
worker threads).
.IP \-x
Scripts too - this causes the program to also return process id's of
shells running the named scripts.
.IP "-o \fIomitpid\fP"
Tells \fIpidof\fP to omit processes with that process id. The special
pid \fB%PPID\fP can be used to name the parent process of the \fIpidof\fP
program, in other words the calling shell or shell script.
.IP "-S \fIseparator\fP"
Use \fIseparator\fP as a separator put between pids. Used only when
more than one pids are printed for the program.
The \fB\-d\fR option is an alias for this option for sysvinit
.B pidof
compatibility.
.SH "EXIT STATUS"
.TP
.B 0
At least one program was found with the requested name.
.TP
.B 1
No program was found with the requested name.
.SH BUGS
When using the \fI\-x\fP option,
.B pidof
only has a simple method for detecting scripts and will miss scripts that,
for example, use env. This limitation is due to how the scripts look in
the proc filesystem.
.SH SEE ALSO
.BR pgrep (1),
.BR pkill (1)
.SH AUTHOR
Jaromir Capik <jcapik@redhat.com>

1
man/pidwait.1 Normal file
View File

@@ -0,0 +1 @@
.so man1/pgrep.1

1
man/pkill.1 Normal file
View File

@@ -0,0 +1 @@
.so man1/pgrep.1

89
man/pmap.1 Normal file
View File

@@ -0,0 +1,89 @@
'\" t
.\" (The preceding line is a note to broken versions of man to tell
.\" them to pre-process this man page with tbl)
.\" Man page for pmap.
.\" Licensed under version 2 of the GNU General Public License.
.\" Written by Albert Cahalan.
.\"
.TH PMAP "1" "2020-06-04" "procps-ng" "User Commands"
.SH NAME
pmap \- report memory map of a process
.SH SYNOPSIS
.B pmap
[\fIoptions\fR] \fIpid\fR [...]
.SH DESCRIPTION
The
.B pmap
command reports the memory map of a process or processes.
.SH OPTIONS
.TP
\fB\-x\fR, \fB\-\-extended\fR
Show the extended format.
.TP
\fB\-d\fR, \fB\-\-device\fR
Show the device format.
.TP
\fB\-q\fR, \fB\-\-quiet\fR
Do not display some header or footer lines.
.TP
\fB\-A\fR, \fB\-\-range\fR \fIlow\fR,\fIhigh\fR
Limit results to the given range to
.I low
and
.I high
address range. Notice that the low and high arguments are single string
separated with comma.
.TP
\fB\-X\fR
Show even more details than the \fB\-x\fR option. WARNING: format changes
according to \fI/proc/PID/smaps\fR
.TP
\fB\-XX\fR
Show everything the kernel provides
.TP
\fB\-p\fR, \fB\-\-show\-path\fR
Show full path to files in the mapping column
.TP
\fB\-c\fR, \fB\-\-read\-rc\fR
Read the default configuration
.TP
\fB\-C\fR, \fB\-\-read\-rc\-from\fR \fIfile\fR
Read the configuration from \fIfile\fR
.TP
\fB\-n\fR, \fB\-\-create\-rc\fR
Create new default configuration
.TP
\fB\-N\fR, \fB\-\-create\-rc\-to\fR \fIfile\fR
Create new configuration to \fIfile\fR
.TP
\fB\-h\fR, \fB\-\-help\fR
Display help text and exit.
.TP
\fB\-V\fR, \fB\-\-version\fR
Display version information and exit.
.SH "EXIT STATUS"
.PP
.RS
.PD 0
.TP
.B 0
Success.
.TP
.B 1
Failure.
.TP
.B 42
Did not find all processes asked for.
.PD
.RE
.SH "SEE ALSO"
.BR ps (1),
.BR pgrep (1)
.SH STANDARDS
No standards apply, but
.B pmap
looks an awful lot like a SunOS command.
.SH "REPORTING BUGS"
Please send bug reports to
.UR procps@freelists.org
.UE

80
man/procio.3 Normal file
View File

@@ -0,0 +1,80 @@
'\" t -*- coding: UTF-8 -*-
.\"
.\" This file describes the readproc interface to the /proc filesystem
.\"
.\" Copyright 2018 Werner Fink <werner@suse.de>
.\"
.\" Permission is granted to make and distribute verbatim copies of this
.\" manual provided the copyright notice and this permission notice are
.\" preserved on all copies.
.\"
.\" Permission is granted to copy and distribute modified versions of this
.\" manual under the conditions for verbatim copying, provided that the
.\" entire resulting derived work is distributed under the terms of a
.\" permission notice identical to this one
.\"
.\" Formatted or processed versions of this manual, if unaccompanied by
.\" the source, must acknowledge the copyright and authors of this work.
.\"
.TH PROCIO 3 "16 January 2018" "Linux Manpage" "Linux Programmer's Manual"
.SH NAME
fprocopen \- stream open functions on files below /proc/##
.SH SYNOPSIS
.B #define _GNU_SOURCE
.br
.B #include <stdio.h>
.br
.B #include <proc/procio.h>
.sp
.BI "FILE *fprocopen(const char *path, const char *mode);
.SH DESCRIPTION
The
.B fprocopen
function opens files below
.I /proc/##
whose name is the string to by path and associates a stream with it.
The argument
.I mode
points to a string containing one of the following sequences
.TP
.B r
Open a file below
.I /proc/##
for reading even large buffers. The stream is positioned at
the beginning of the file.
.TP
.BR w [ <del> ]
Open a file below
.I /proc/##
for writing even large buffers. The optional delimiter character
can be one of the follwoing
.BR '\ ' ,\ ',' ,\ '.' ,\ and\ ':'
where the default is the comma
.BR ',' .
This allows to split very large input lines into pieces at this
delimiter and write each of them to the opened file below
.IR /proc/## .
.TP
.B e
The underlying file descriptor will be closed if you use any
of the `exec...' functions within your code.
.PP
The internal API allows the use of stdio functions to read and write
large buffers below
.IR /proc/## .
.PP
.SH SEE ALSO
.BR fopen (3),
.br
.BR fopencookie (3)
.br
.BR setvbuf (3)
.br
.BR lseek (3)
.PP
.SH COPYRIGHT
2018 Werner Fink,
.SH AUTHOR
Werner Fink <werner@suse.de>

193
man/procps.3 Normal file
View File

@@ -0,0 +1,193 @@
.\" (C) Copyright 2020-2022 Jim Warner <james.warner@comcast.net>
.\"
.\" %%%LICENSE_START(LGPL_2.1+)
.\" This manual is free software; you can redistribute it and/or
.\" modify it under the terms of the GNU Lesser General Public
.\" License as published by the Free Software Foundation; either
.\" version 2.1 of the License, or (at your option) any later version.
.\"
.\" This manual is distributed in the hope that it will be useful,
.\" but WITHOUT ANY WARRANTY; without even the implied warranty of
.\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
.\" Lesser General Public License for more details.
.\"
.\" You should have received a copy of the GNU Lesser General Public
.\" License along with this library; if not, write to the Free Software
.\" Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
.\" %%%LICENSE_END
.\"
.TH PROCPS 3 "July 2022" "libproc-2"
.\" Please adjust this date whenever revising the manpage.
.\"
.nh
.SH NAME
procps \- API to access system level information in the /proc filesystem
.SH SYNOPSIS
Five distinct interfaces are represented in this synopsis and named after
the files they access in the /proc pseudo filesystem:
.BR diskstats ", " meminfo ", " slabinfo ", " stat " and " vmstat .
.nf
.RS +4
#include <procps/\fBnamed_interface\fR.h>
.RI "int\fB procps_new \fR (struct info **" info );
.RI "int\fB procps_ref \fR (struct info *" info );
.RI "int\fB procps_unref\fR (struct info **" info );
.RB "struct result *" procps_get " ("
.RI " struct info *" info ,
.RI "[ const char *" name ", ] \fBdiskstats\fR api only"
.RI " enum item " item );
.RB "struct stack *" procps_select " ("
.RI " struct info *" info ,
.RI "[ const char *" name ", ] \fBdiskstats\fR api only"
.RI " enum item *" items ,
.RI " int " numitems );
.RB "struct reaped *" procps_reap " ("
.RI " struct info *" info ,
.RI "[ enum reap_type " what ", ] \fBstat\fR api only"
.RI " enum item *" items ,
.RI " int " numitems );
.RB "struct stack **" procps_sort " ("
.RI " struct info *" info ,
.RI " struct stack *" stacks [],
.RI " int " numstacked ,
.RI " enum item " sortitem ,
.RI " enum sort_order " order );
.fi
The above functions and structures are generic but the specific
\fBnamed_interface\fR would also be part of any identifiers.
For example, `procps_new' would actually be `procps_\fBmeminfo\fR_new'
and `info' would really be `\fBdiskstats\fR_info', etc.
The same \fBnamed_interface\fR is used in each header file name with
an appended `.h' suffix.
Link with \fI\-lproc-2\fP.
.SH DESCRIPTION
.SS Overview
Central to these interfaces is a simple `result'
structure reflecting an `item' plus its value (in a union
with standard C language types as members).
All `result' structures are automatically allocated and
provided by the library.
By specifying an array of `items', these structures can be
organized as a `stack', potentially yielding many results
with a single function call.
Thus, a `stack' can be viewed as a variable length record
whose content and order is determined solely by the user.
As part of each interface there are two unique enumerators.
The `noop' and `extra' items exist to hold user values.
They are never set by the library, but the `extra'
result will be zeroed with each library interaction.
The \fBnamed_interface\fR header file will be an essential
document during user program development.
There you will find available items, their return type
(the `result' struct member name) and the source for such values.
Additional enumerators and structures are also documented there.
.SS Usage
The following would be a typical sequence of calls to
these interfaces.
.nf
.RB "1. " procps_new()
.RB "2. " procps_get() ", " procps_select() " or " procps_reap()
.RB "3. " procps_unref()
.fi
The \fBget\fR function is used to retrieve a `result' structure for
a single `item'.
Alternatively, a \fBGET\fR macro is available when only the return
value is of interest.
The \fBselect\fR function can retrieve multiple `result' structures
in a single `stack'.
For unpredictable variable outcomes, the \fBdiskstats\fR, \fBslabinfo\fR
and \fBstat\fR interfaces export a \fBreap\fR function.
It is used to retrieve multiple `stacks' each containing multiple
`result' structures.
Optionally, a user may choose to \fBsort\fR those results.
To exploit any `stack', and access individual `result' structures,
a \fIrelative_enum\fR is required as shown in the \fBVAL\fR macro
defined in the header file.
Such values could be hard coded as: 0 through numitems-1.
However, this need is typically satisfied by creating your own
enumerators corresponding to the order of the `items' array.
.SS Caveats
The \fBnew\fR, \fBref\fR, \fBunref\fR, \fBget\fR and \fBselect\fR
functions are available in all five interfaces.
For the \fBnew\fR and \fBunref\fR functions, the address of an \fIinfo\fR
struct pointer must be supplied.
With \fBnew\fR it must have been initialized to NULL.
With \fBunref\fR it will be reset to NULL if the reference count reaches zero.
In the case of the \fBdiskstats\fR interface, a \fIname\fR parameter
on the \fBget\fR and \fBselect\fR functions identifies a disk or
partition name
For the \fBstat\fR interface, a \fIwhat\fR parameter on the \fBreap\fR
function identifies whether data for just CPUs or both CPUs and NUMA
nodes is to be gathered.
When using the \fBsort\fR function, the parameters \fIstacks\fR and
\fInumstacked\fR would normally be those returned in the `reaped'
structure.
.SH RETURN VALUE
.SS Functions Returning an `int'
An error will be indicated by a negative number that
is always the inverse of some well known errno.h value.
Success is indicated by a zero return value.
However, the \fBref\fR and \fBunref\fR functions return
the current \fIinfo\fR structure reference count.
.SS Functions Returning an `address'
An error will be indicated by a NULL return pointer
with the reason found in the formal errno value.
Success is indicated by a pointer to the named structure.
.SH DEBUGGING
To aid in program development, there is a provision that can
help ensure `result' member references agree with library
expectations.
It assumes that a supplied macro in the header file is
used to access the `result' value.
This feature can be activated through either of the following
methods and any discrepancies will be written to \fBstderr\fR.
.IP 1) 3
Add CFLAGS='-DXTRA_PROCPS_DEBUG' to any other ./configure
options employed.
.IP 2) 3
Add #include <procps/xtra-procps-debug.h> to any program
\fIafter\fR the named interface includes.
.PP
This verification feature incurs substantial overhead.
Therefore, it is important that it \fInot\fR be activated
for a production/release build.
.SH SEE ALSO
.BR procps_misc (3),
.BR procps_pids (3),
.BR proc (5).

165
man/procps_misc.3 Normal file
View File

@@ -0,0 +1,165 @@
.\" (C) Copyright 2020 Craig Small <csmall@dropbear.xyz>
.\" (C) Copyright 2021-2022 Jim Warner <james.warner@comcast.net>
.\"
.\" %%%LICENSE_START(LGPL_2.1+)
.\" This manual is free software; you can redistribute it and/or
.\" modify it under the terms of the GNU Lesser General Public
.\" License as published by the Free Software Foundation; either
.\" version 2.1 of the License, or (at your option) any later version.
.\"
.\" This manual is distributed in the hope that it will be useful,
.\" but WITHOUT ANY WARRANTY; without even the implied warranty of
.\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
.\" Lesser General Public License for more details.
.\"
.\" You should have received a copy of the GNU Lesser General Public
.\" License along with this library; if not, write to the Free Software
.\" Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
.\" %%%LICENSE_END
.\"
.TH PROCPS_MISC 3 "July 2022" "libproc-2"
.\" Please adjust this date whenever revising the manpage.
.\"
.nh
.SH NAME
procps_misc \- API for miscellaneous information in the /proc filesystem
.SH SYNOPSIS
.nf
.B #include <procps/misc.h>
.PP
Platform Particulars
.RS 4
.PP
.RB "long " procps_cpu_count " (void);
.RB "long " procps_hertz_get " (void);
.RB "unsigned int " procps_pid_length " (void);
.RB "int " procps_linux_version " (void);
.RE
.PP
Runtime Particulars
.PP
.RS 4
.RI "int \fB procps_loadavg\fR (double *" av1 ", double *" av5 ", double *" av15 ");"
.RI "int \fB procps_uptime\fR (double *" uptime_secs ", double *" idle_secs ");"
.RB "char *" procps_uptime_sprint " (void);"
.RB "char *" procps_uptime_sprint_short " (void);"
.RE
.PP
Namespace Particulars
.PP
.RS 4
.RI "int \fB procps_ns_get_id\fR (const char *" name ");"
.RI "const char\fB *procps_ns_get_name\fR (int " id ");"
.RI "int \fB procps_ns_read_pid\fR (int " pid ", struct procps_ns *" nsp ");"
.RE
Link with \fI\-lproc-2\fP.
.SH DESCRIPTION
.BR procps_cpu_count ()
returns the number of CPUs that are currently online as
.BI sysconf( _SC_NPROCESSORS_ONLY )
or an assumed \fI1\fR.
.BR procps_hertz_get ()
returns the number of clock ticks per second as
.BI sysconf( _SC_CLK_TCK )
or an assumed \fI100\fR.
Dividing tics by this value yields seconds.
.BR procps_pid_length ()
returns the maximum string length for a PID on the system. For example, if the largest
possible PID value on was 123, then the length would be 3. If the file
\fI/proc/sys/kernel/pid_max\fR is unreadable, the value is assumed to be \fI5\fR.
.BR procps_linux_version ()
returns the current Linux version as an encoded integer. On non-Linux systems that
have an emulated proc filesystem this function returns the version of the
Linux emulation instead.
The version consists of three positive integers representing the major,
minor and patch levels.
The following macros are provided for encoding a given Linux version or
separating out the components of the current version.
.RS 4
.PP
LINUX_VERSION(\ major\ ,\ minor\ ,\ patch\ )
.PP
LINUX_VERSION_MAJOR(\ ver\ )
.PP
LINUX_VERSION_MINOR(\ ver\ )
.PP
LINUX_VERSION_PATCH(\ ver\ )
.RE
.BR procps_loadavg ()
fetches the system load average and puts the 1, 5 and 15 minute averages into
location(s) specified by any pointer which is not \fINULL\fR.
.BR procps_uptime ()
returns uptime and/or idle seconds into location(s) specified by any pointer
which is not \fINULL\fR.
The \fBsprint\fR varieties return a human-readable string in one of two forms.
.RS 4
.PP
HH:MM:SS up HH:MM, # users, load average: 1, 5, 15 MM averages
.PP
up HH, MM
.RE
.BR procps_ns_get_id ()
returns the integer id (enum namespace_type) of the namespace for the given namespace \fIname\fR.
.BR procps_ns_get_name ()
returns the name of the namespace for the given \fIid\fR (enum namespace_type).
.BR procps_ns_read_pid ()
returns the inodes for the namespaces of the given process in the
procps_ns structure pointed to by \fInsp\fR.
Those inodes will appear in the order proscribed by enum namespace_type.
.PP
.RS 4
.nf
enum namespace_type {
PROCPS_NS_CGROUP,
PROCPS_NS_IPC,
PROCPS_NS_MNT,
PROCPS_NS_NET,
PROCPS_NS_PID,
PROCPS_NS_TIME,
PROCPS_NS_USER,
PROCPS_NS_UTS
};
.fi
.RE
.SH RETURN VALUE
.SS Functions Returning an `int' or `long'
An error will be indicated by a negative number that
is always the inverse of some well known errno.h value.
.SS Functions Returning an `address'
An error will be indicated by a NULL return pointer
with the reason found in the formal errno value.
.SH FILES
.TP
.I /proc/loadavg
The raw values for load average.
.TP
.I /proc/sys/kernel/osrelease
Contains the release version of the Linux kernel or proc filesystem.
.TP
.I /proc/sys/kernel/pid_max
Contains the value at which PIDs wrap around, one greater than the maximum PID value.
.TP
.I /proc/uptime
The raw values for uptime and idle time.
.TP
.IB /proc/<PID>/ns
contains the set of namespaces for a particular \fBPID\fR.
.SH SEE ALSO
.BR procps (3),
.BR procps_pids (3),
.BR proc (5).

218
man/procps_pids.3 Normal file
View File

@@ -0,0 +1,218 @@
.\" (C) Copyright 2020-2022 Jim Warner <james.warner@comcast.net>
.\"
.\" %%%LICENSE_START(LGPL_2.1+)
.\" This manual is free software; you can redistribute it and/or
.\" modify it under the terms of the GNU Lesser General Public
.\" License as published by the Free Software Foundation; either
.\" version 2.1 of the License, or (at your option) any later version.
.\"
.\" This manual is distributed in the hope that it will be useful,
.\" but WITHOUT ANY WARRANTY; without even the implied warranty of
.\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
.\" Lesser General Public License for more details.
.\"
.\" You should have received a copy of the GNU Lesser General Public
.\" License along with this library; if not, write to the Free Software
.\" Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
.\" %%%LICENSE_END
.\"
.TH PROCPS_PIDS 3 "July 2022" "libproc-2"
.\" Please adjust this date whenever revising the manpage.
.\"
.nh
.SH NAME
procps_pids \- API to access process information in the /proc filesystem
.SH SYNOPSIS
.nf
#include <procps/pids.h>
.RI "int\fB procps_pids_new \fR (struct pids_info **" info ", enum pids_item *" items ", int " numitems );
.RI "int\fB procps_pids_ref \fR (struct pids_info *" info );
.RI "int\fB procps_pids_unref\fR (struct pids_info **" info );
.RB "struct pids_stack *" procps_pids_get " ("
.RI " struct pids_info *" info ,
.RI " enum pids_fetch_type " which );
.RB "struct pids_fetch *" procps_pids_reap " ("
.RI " struct pids_info *" info ,
.RI " enum pids_fetch_type " which );
.RB "struct pids_fetch *" procps_pids_select " ("
.RI " struct pids_info *" info ,
.RI " unsigned *" these ,
.RI " int " numthese ,
.RI " enum pids_select_type " which );
.RB "struct pids_stack **" procps_pids_sort " ("
.RI " struct pids_info *" info ,
.RI " struct pids_stack *" stacks [],
.RI " int " numstacked ,
.RI " enum pids_item " sortitem ,
.RI " enum pids_sort_order " order );
.RB "int " procps_pids_reset " ("
.RI " struct pids_info *" info ,
.RI " enum pids_item *" newitems ,
.RI " int " newnumitems );
.RB "struct pids_stack *" fatal_proc_unmounted " ("
.RI " struct pids_info *" info ,
.RI " int " return_self );
.fi
Link with \fI\-lproc-2\fP.
.SH DESCRIPTION
.SS Overview
Central to this interface is a simple `result'
structure reflecting an `item' plus its value (in a union
with standard C language types as members).
All `result' structures are automatically allocated and
provided by the library.
By specifying an array of `items', these structures can be
organized as a `stack', potentially yielding many results
with a single function call.
Thus, a `stack' can be viewed as a variable length record
whose content and order is determined solely by the user.
As part of this interface there are two unique enumerators.
The `noop' and `extra' items exist to hold user values.
They are never set by the library, but the `extra'
result will be zeroed with each library interaction.
The pids.h file will be an essential document during
user program development.
There you will find available items, their return type
(the `result' struct member name) and the source for such values.
Additional enumerators and structures are also documented there.
.SS Usage
The following would be a typical sequence of calls to
this interface.
.nf
.RB "1. " fatal_proc_unmounted()
.RB "2. " procps_pids_new()
.RB "3. " procps_pids_get() ", " procps_pids_reap() " or " procps_pids_select()
.RB "4. " procps_pids_unref()
.fi
The \fBget\fR function is an iterator for successive PIDs/TIDs,
returning those `items' previously identified via \fBnew\fR
or \fBreset\fR.
Two functions support unpredictable variable outcomes.
The \fBreap\fR function gathers data for all processes while
the \fBselect\fR function deals with specific PIDs or UIDs.
Both can return multiple `stacks' each containing multiple `result'
structures.
Optionally, a user may choose to \fBsort\fR such results
To exploit any `stack', and access individual `result' structures,
a \fIrelative_enum\fR is required as shown in the \fBVAL\fR macro
defined in the header file.
Such values could be hard coded as: 0 through numitems-1.
However, this need is typically satisfied by creating your own
enumerators corresponding to the order of the `items' array.
.SS Caveats
The <pids> API differs from others in that those items
of interest must be provided at \fBnew\fR or \fBreset\fR time,
the latter being unique to this API.
If either the \fIitems\fR or \fInumitems\fR parameter is zero at
\fBnew\fR time, then \fBreset\fR becomes mandatory before
issuing any other call.
For the \fBnew\fR and \fBunref\fR functions, the address of an \fIinfo\fR
struct pointer must be supplied.
With \fBnew\fR it must have been initialized to NULL.
With \fBunref\fR it will be reset to NULL if the reference count reaches zero.
The \fBget\fR and \fBreap\fR functions use the \fIwhich\fR parameter
to specify whether just tasks or both tasks and threads are to be fetched.
The \fBselect\fR function requires an array of PIDs or UIDs as
\fIthese\fR along with \fInumthese\fR to identify which processes
are to be fetched.
This function then operates as a subset of \fBreap\fR.
When using the \fBsort\fR function, the parameters \fIstacks\fR and
\fInumstacked\fR would normally be those returned in the `pids_fetch'
structure.
Lastly, a \fBfatal_proc_unmounted\fR function may be called before
any other function to ensure that the /proc/ directory is mounted.
As such, the \fIinfo\fR parameter would be NULL and the
\fIreturn_self\fR parameter zero.
If, however, some items are desired for the issuing program (a
\fIreturn_self\fR other than zero) then the \fBnew\fR call must precede
it to identify the \fIitems\fR and obtain the required \fIinfo\fR pointer.
.SH RETURN VALUE
.SS Functions Returning an `int'
An error will be indicated by a negative number that
is always the inverse of some well known errno.h value.
Success is indicated by a zero return value.
However, the \fBref\fR and \fBunref\fR functions return
the current \fIinfo\fR structure reference count.
.SS Functions Returning an `address'
An error will be indicated by a NULL return pointer
with the reason found in the formal errno value.
Success is indicated by a pointer to the named structure.
However, if one survives the \fBfatal_proc_unmounted\fR call,
NULL is always returned when \fIreturn_self\fR is zero.
.SH DEBUGGING
To aid in program development, there are two procps-ng provisions
that can be exploited.
The first is a supplied file named `libproc.supp' which may be
useful when developing a \fImulti-threaded\fR application.
When used with the valgrind `--suppressions=' option, warnings
associated with the procps library itself are avoided.
Such warnings arise because the library handles heap based
allocations in a thread-safe manner.
A \fIsingle-threaded\fR application will not receive those warnings.
The second provision can help ensure `result' member references
agree with library expectations.
It assumes that a supplied macro in the header file is
used to access the `result' value.
This feature can be activated through either of the following
methods and any discrepancies will be written to \fBstderr\fR.
.IP 1) 3
Add CFLAGS='-DXTRA_PROCPS_DEBUG' to any other ./configure
options your project may employ.
.IP 2) 3
Add #include <procps/xtra-procps-debug.h> to any program
\fIafter\fR the #include <procps/pids.h>.
.PP
This verification feature incurs substantial overhead.
Therefore, it is important that it \fInot\fR be activated
for a production/release build.
.SH ENVIRONMENT VARIABLE(S)
The value set for the following is unimportant, just its presence.
.IP LIBPROC_HIDE_KERNEL
This will hide kernel threads which would otherwise be returned with a
.BR procps_pids_get ", " procps_pids_select " or " procps_pids_reap
call.
.SH SEE ALSO
.BR procps (3),
.BR procps_misc (3),
.BR proc (5).

2116
man/ps.1 Normal file

File diff suppressed because it is too large Load Diff

34
man/pwdx.1 Normal file
View File

@@ -0,0 +1,34 @@
.\" Man page for pwdx
.\" Licensed under version 2 of the GNU General Public License.
.\" Copyright 2004 Nicholas Miell.
.\" Based on the pmap(1) man page by Albert Cahalan.
.\"
.TH PWDX "1" "2020-06-04" "procps-ng" "User Commands"
.SH NAME
pwdx \- report current working directory of a process
.SH SYNOPSIS
.B pwdx
[\fIoptions\fR] \fIpid\fR [...]
.SH OPTIONS
.TP
\fB\-V\fR, \fB\-\-version\fR
Output version information and exit.
.TP
\fB\-h\fR, \fB\-\-help\fR
Output help screen and exit.
.SH "SEE ALSO"
.BR ps (1),
.BR pgrep (1)
.SH STANDARDS
No standards apply, but
.B pwdx
looks an awful lot like a SunOS command.
.SH AUTHOR
.UR nmiell@gmail.com
Nicholas Miell
.UE
wrote pwdx in 2004.
.SH "REPORTING BUGS"
Please send bug reports to
.UR procps@freelists.org
.UE

121
man/skill.1 Normal file
View File

@@ -0,0 +1,121 @@
'\" t
.\" (The preceding line is a note to broken versions of man to tell
.\" them to pre-process this man page with tbl)
.\" Man page for skill and snice.
.\" Licensed under version 2 of the GNU General Public License.
.\" Written by Albert Cahalan, converted to a man page by
.\" Michael K. Johnson
.\"
.TH SKILL 1 "October 2011" "procps-ng" "User Commands"
.SH NAME
skill, snice \- send a signal or report process status
.SH SYNOPSIS
.B skill
.RI [ signal ]
.RI [ options ]
.I expression
.br
.B snice
.RI [ "new priority" ]
.RI [ options ]
.I expression
.SH DESCRIPTION
These tools are obsolete and unportable. The command syntax is
poorly defined. Consider using the killall, pkill, and pgrep
commands instead.
.PP
The default signal for skill is TERM. Use \-l or \-L to list
available signals. Particularly useful signals include HUP, INT,
KILL, STOP, CONT, and 0. Alternate signals may be specified in three
ways: \-9 \-SIGKILL \-KILL.
.PP
The default priority for snice is +4. Priority numbers range from
+20 (slowest) to \-20 (fastest). Negative priority numbers are
restricted to administrative users.
.SH OPTIONS
.TP
.BR \-f , \ \-\-fast
Fast mode. This option has not been implemented.
.TP
.BR \-i , \ \-\-interactive
Interactive use. You will be asked to approve each action.
.TP
.BR \-l , \ \-\-list
List all signal names.
.TP
.BR \-L , \ \-\-table
List all signal names in a nice table.
.TP
.BR \-n , \ \-\-no\-action
No action; perform a simulation of events that would occur but do not
actually change the system.
.TP
.BR \-v , \ \-\-verbose
Verbose; explain what is being done.
.TP
.BR \-w , \ \-\-warnings
Enable warnings. This option has not been implemented.
.TP
\fB\-h\fR, \fB\-\-help\fR
Display help text and exit.
.TP
\fB\-V\fR, \fB\-\-version\fR
Display version information.
.PD
.SH "PROCESS SELECTION OPTIONS"
Selection criteria can be: terminal, user, pid, command. The options
below may be used to ensure correct interpretation.
.TP
\fB\-t\fR, \fB\-\-tty\fR \fItty\fR
The next expression is a terminal (tty or pty).
.TP
\fB\-u\fR, \fB\-\-user\fR \fIuser\fR
The next expression is a username.
.TP
\fB\-p\fR, \fB\-\-pid\fR \fIpid\fR
The next expression is a process ID number.
.TP
\fB\-c\fR, \fB\-\-command\fR \fIcommand\fR
The next expression is a command name.
.TP
\fB\-\-ns \fIpid\fR
Match the processes that belong to the same namespace as pid.
.TP
\fB\-\-nslist \fIns,...\fR
list which namespaces will be considered for the --ns option.
Available namespaces: ipc, mnt, net, pid, user, uts.
.PD
.SH SIGNALS
The behavior of signals is explained in
.BR signal (7)
manual page.
.SH EXAMPLES
.TP
.B snice -c seti -c crack +7
Slow down seti and crack commands.
.TP
.B skill \-KILL \-t /dev/pts/*
Kill users on PTY devices.
.TP
.B skill \-STOP \-u viro \-u lm \-u davem
Stop three users.
.SH "SEE ALSO"
.BR kill (1),
.BR kill (2),
.BR killall (1),
.BR nice (1),
.BR pkill (1),
.BR renice (1),
.BR signal (7)
.SH STANDARDS
No standards apply.
.SH AUTHOR
.UR albert@users.sf.net
Albert Cahalan
.UE
wrote skill and snice in 1999 as a replacement for a non-free
version.
.SH "REPORTING BUGS"
Please send bug reports to
.UR procps@freelists.org
.UE

108
man/slabtop.1 Normal file
View File

@@ -0,0 +1,108 @@
.\" slabtop.1 - manpage for the slabtop(1) utility, part of procps-ng
.\"
.\" Copyright (C) 2003 Chris Rivera
.\" Licensed under the terms of the GNU Library General Public License, v2
.TH SLABTOP "1" "2021-03-11" "procps-ng" "User Commands"
.SH NAME
slabtop \- display kernel slab cache information in real time
.SH SYNOPSIS
.B slabtop
[\fIoptions\fR]
.SH DESCRIPTION
.B slabtop
displays detailed kernel slab cache information in real time. It displays a
listing of the top caches sorted by one of the listed sort criteria. It also
displays a statistics header filled with slab layer information.
.SH OPTIONS
Normal invocation of
.B slabtop
does not require any options. The behavior, however, can be fine-tuned by
specifying one or more of the following flags:
.TP
\fB\-d\fR, \fB\-\-delay\fR=\fIN\fR
Refresh the display every
.I n
in seconds. By default,
.B slabtop
refreshes the display every three seconds. To exit the program, hit
.BR q .
This cannot be combined with the \fB-o\fR option.
.TP
\fB\-s\fR, \fB\-\-sort\fR=\fIS\fR
Sort by \fIS\fR, where \fIS\fR is one of the sort criteria.
.TP
\fB\-o\fR, \fB\-\-once\fR
Display the output once and then exit.
.TP
\fB\-V\fR, \fB\-\-version\fR
Display version information and exit.
.TP
\fB\-h\fR, \fB\-\-help\fR
Display usage information and exit.
.SH SORT CRITERIA
The following are valid sort criteria used to sort the individual slab caches
and thereby determine what are the "top" slab caches to display. The default
sort criteria is to sort by the number of objects ("o").
.PP
The sort criteria can also be changed while
.B slabtop
is running by pressing the associated character.
.TS
l l l.
\fBcharacter description header\fR
a number of active objects ACTIVE
b objects per slab OBJ/SLAB
c cache size CACHE SIZE
l number of slabs SLABS
v number of active slabs N/A
n name NAME\:
o number of objects OBJS
p pages per slab N/A
s object size OBJ SIZE
u cache utilization USE
.TE
.SH COMMANDS
.B slabtop
accepts keyboard commands from the user during use. The following are
supported. In the case of letters, both cases are accepted.
.PP
Each of the valid sort characters are also accepted, to change the sort
routine. See the section
.BR "SORT CRITERIA" .
.TP
.BR <SPACEBAR>
Refresh the screen.
.TP
.BR Q
Quit the program.
.SH FILES
.TP
.I /proc/slabinfo
slab information
.SH "SEE ALSO"
.BR free (1),
.BR ps (1),
.BR top (1),
.BR vmstat (8)
.SH NOTES
Currently,
.B slabtop
requires a 2.4 or later kernel (specifically, a version 1.1 or later
.IR /proc/slabinfo ).
Kernel 2.2 should be supported in the future.
.PP
The
.B slabtop
statistic header is tracking how many bytes of slabs are being
used and is not a measure of physical memory. The 'Slab' field in the
/proc/meminfo file is tracking information about used slab physical memory.
.SH AUTHORS
Written by Chris Rivera and Robert Love.
.PP
.B slabtop
was inspired by Martin Bligh's perl script,
.BR vmtop .
.SH "REPORTING BUGS"
Please send bug reports to
.UR procps@freelists.org
.UE

1
man/snice.1 Normal file
View File

@@ -0,0 +1 @@
.so man1/skill.1

189
man/sysctl.8 Normal file
View File

@@ -0,0 +1,189 @@
.\" Copyright 1999, George Staikos (staikos@0wned.org)
.\" This file may be used subject to the terms and conditions of the
.\" GNU General Public License Version 2, or any later version
.\" at your option, as published by the Free Software Foundation.
.\" This program is distributed in the hope that it will be useful,
.\" but WITHOUT ANY WARRANTY; without even the implied warranty of
.\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
.\" GNU General Public License for more details."
.TH SYSCTL "8" "2021-03-29" "procps-ng" "System Administration"
.SH NAME
sysctl \- configure kernel parameters at runtime
.SH SYNOPSIS
.B sysctl
[\fIoptions\fR] [\fIvariable\fR[\fB=\fIvalue\fR]] [...]
.br
.B sysctl \-p
[\fIfile\fR or \fIregexp\fR] [...]
.SH DESCRIPTION
.B sysctl
is used to modify kernel parameters at runtime. The parameters available
are those listed under /proc/sys/. Procfs is required for
.B sysctl
support in Linux. You can use
.B sysctl
to both read and write sysctl data.
.SH PARAMETERS
.TP
.I variable
The name of a key to read from. An example is kernel.ostype. The '/'
separator is also accepted in place of a '.'.
.TP
.IR variable = value
To set a key, use the form
.IR variable = value
where
.I variable
is the key and
.I value
is the value to set it to. If the value contains quotes or characters
which are parsed by the shell, you may need to enclose the value in double
quotes.
.TP
\fB\-n\fR, \fB\-\-values\fR
Use this option to disable printing of the key name when printing values.
.TP
\fB\-e\fR, \fB\-\-ignore\fR
Use this option to ignore errors about unknown keys.
.TP
\fB\-N\fR, \fB\-\-names\fR
Use this option to only print the names. It may be useful with shells that
have programmable completion.
.TP
\fB\-q\fR, \fB\-\-quiet\fR
Use this option to not display the values set to stdout.
.TP
\fB\-w\fR, \fB\-\-write\fR
Use this option when all arguments prescribe a key to be set.
.TP
\fB\-p\fR[\fIFILE\fR], \fB\-\-load\fR[=\fIFILE\fR]
Load in sysctl settings from the file specified or /etc/sysctl.conf if none
given. Specifying \- as filename means reading data from standard input.
Using this option will mean arguments to
.B sysctl
are files, which are read in the order they are specified.
The file argument may be specified as regular expression.
.TP
\fB\-a\fR, \fB\-\-all\fR
Display all values currently available.
.TP
\fB\-\-deprecated\fR
Include deprecated parameters to
.B \-\-all
values listing.
.TP
\fB\-b\fR, \fB\-\-binary\fR
Print value without new line.
.TP
\fB\-\-system\fR
Load settings from all system configuration files. See the
.B SYSTEM FILE PRECEDENCE
section below.
.TP
\fB\-r\fR, \fB\-\-pattern\fR \fIpattern\fR
Only apply settings that match
.IR pattern .
The
.I pattern
uses extended regular expression syntax.
.TP
\fB\-A\fR
Alias of \fB\-a\fR
.TP
\fB\-d\fR
Alias of \fB\-h\fR
.TP
\fB\-f\fR
Alias of \fB\-p\fR
.TP
\fB\-X\fR
Alias of \fB\-a\fR
.TP
\fB\-o\fR
Does nothing, exists for BSD compatibility.
.TP
\fB\-x\fR
Does nothing, exists for BSD compatibility.
.TP
\fB\-h\fR, \fB\-\-help\fR
Display help text and exit.
.TP
\fB\-V\fR, \fB\-\-version\fR
Display version information and exit.
.SH SYSTEM FILE PRECEDENCE
When using the \fB\-\-system\fR option,
.B sysctl
will read files from directories in the following list in given
order from top to bottom. Once a file of a given filename is loaded, any
file of the same name in subsequent directories is ignored.
/etc/sysctl.d/*.conf
.br
/run/sysctl.d/*.conf
.br
/usr/local/lib/sysctl.d/*.conf
.br
/usr/lib/sysctl.d/*.conf
.br
/lib/sysctl.d/*.conf
.br
/etc/sysctl.conf
All configuration files are sorted in lexicographic order, regardless of the
directory they reside in. Configuration files can either be completely
replaced (by having a new configuration file with the same name in a
directory of higher priority) or partially replaced (by having a configuration
file that is ordered later).
.SH EXAMPLES
/sbin/sysctl \-a
.br
/sbin/sysctl \-n kernel.hostname
.br
/sbin/sysctl \-w kernel.domainname="example.com"
.br
/sbin/sysctl \-p/etc/sysctl.conf
.br
/sbin/sysctl \-a \-\-pattern forward
.br
/sbin/sysctl \-a \-\-pattern forward$
.br
/sbin/sysctl \-a \-\-pattern 'net.ipv4.conf.(eth|wlan)0.arp'
.br
/sbin/sysctl \-\-pattern '\[char94]net.ipv6' \-\-system
.SH DEPRECATED PARAMETERS
The
.B base_reachable_time
and
.B retrans_time
are deprecated. The
.B sysctl
command does not allow changing values of these
parameters. Users who insist to use deprecated kernel interfaces should push values
to /proc file system by other means. For example:
.PP
echo 256 > /proc/sys/net/ipv6/neigh/eth0/base_reachable_time
.SH FILES
.I /proc/sys
.br
.I /etc/sysctl.d/*.conf
.br
.I /run/sysctl.d/*.conf
.br
.I /usr/local/lib/sysctl.d/*.conf
.br
.I /usr/lib/sysctl.d/*.conf
.br
.I /lib/sysctl.d/*.conf
.br
.I /etc/sysctl.conf
.SH SEE ALSO
.BR sysctl.conf (5)
.BR regex (7)
.SH AUTHOR
.UR staikos@0wned.org
George Staikos
.UE
.SH "REPORTING BUGS"
Please send bug reports to
.UR procps@freelists.org
.UE

88
man/sysctl.conf.5 Normal file
View File

@@ -0,0 +1,88 @@
.\" Copyright 1999, George Staikos (staikos@0wned.org)
.\" This file may be used subject to the terms and conditions of the
.\" GNU General Public License Version 2, or any later version
.\" at your option, as published by the Free Software Foundation.
.\" This program is distributed in the hope that it will be useful,
.\" but WITHOUT ANY WARRANTY; without even the implied warranty of
.\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
.\" GNU General Public License for more details."
.TH SYSCTL.CONF "5" "2021-09-15" "procps-ng" "File Formats"
.SH NAME
sysctl.conf \- sysctl preload/configuration file
.SH DESCRIPTION
.B sysctl.conf
is a simple file containing sysctl values to be read in and set by
.BR sysctl .
The syntax is simply as follows:
.RS
.sp
.nf
.ne 7
# comment
; comment
token = value
.fi
.RE
.PP
Note that blank lines are ignored, and whitespace before and after a token or
value is ignored, although a value can contain whitespace within. Lines which
begin with a \fI#\fR or \fI;\fR are considered comments and ignored.
If a line begins with a single \-, any attempts to set the value that fail will be
ignored.
.SH NOTES
As the
.BR /etc/sysctl.conf
file is used to override default kernel parameter values, only a small number of parameters is predefined in the file.
Use
.IR /sbin/sysctl\ \-a
or follow
.BR sysctl (8)
to list all possible parameters. The description of individual parameters can be found in the kernel documentation.
Maximum supported line length of the value is 4096 characters due
to a limitation of \fI/proc\fR entries in Linux kernel.
.SH EXAMPLE
.RS
.sp
.nf
.ne 7
# sysctl.conf sample
#
kernel.domainname = example.com
; this one has a space which will be written to the sysctl!
kernel.modprobe = /sbin/mod probe
.fi
.RE
.PP
.SH FILES
.I /etc/sysctl.d/*.conf
.br
.I /run/sysctl.d/*.conf
.br
.I /usr/local/lib/sysctl.d/*.conf
.br
.I /usr/lib/sysctl.d/*.conf
.br
.I /lib/sysctl.d/*.conf
.br
.I /etc/sysctl.conf
The paths where
.B sysctl
preload files usually exist. See also
.B sysctl
option
.IR \-\-system .
.SH SEE ALSO
.BR sysctl (8)
.SH AUTHOR
.UR staikos@0wned.org
George Staikos
.UE
.SH "REPORTING BUGS"
Please send bug reports to
.UR procps@freelists.org
.UE

61
man/tload.1 Normal file
View File

@@ -0,0 +1,61 @@
.\" -*-Nroff-*-
.\" This page Copyright (C) 1993 Matt Welsh, mdw@tc.cornell.edu.
.\" Freely distributable under the terms of the GPL
.TH TLOAD "1" "2020-06-04" "procps-ng" "User Commands"
.SH NAME
tload \- graphic representation of system load average
.SH SYNOPSIS
.B tload
[\fIoptions\fR] [\fItty\fR]
.SH DESCRIPTION
.B tload
prints a graph of the current system load average to the specified
.I tty
(or the tty of the
.B tload
process if none is specified).
.SH OPTIONS
.TP
\fB\-s\fR, \fB\-\-scale\fR \fInumber\fR
The scale option allows a vertical scale to be specified for the display (in
characters between graph ticks); thus, a smaller value represents a larger
scale, and vice versa.
.TP
\fB\-d\fR, \fB\-\-delay\fR \fIseconds\fR
The delay sets the delay between graph updates in
.IR seconds .
.TP
\fB\-h\fR, \fB\-\-help\fR
Display this help text.
.TP
\fB\-V\fR, \fB\-\-version\fR
Display version information and exit.
.PP
.SH FILES
.I /proc/loadavg
load average information
.SH "SEE ALSO"
.BR ps (1),
.BR top (1),
.BR uptime (1),
.BR w (1)
.SH BUGS
The
.BI "\-d" " delay"
option sets the time argument for an
.BR alarm (2);
if \-d 0 is specified, the alarm is set to 0, which will never send the
.B SIGALRM
and update the display.
.SH AUTHORS
Branko Lankester,
.UR david@\:ods.\:com
David Engel
.UE , and
.UR johnsonm@\:redhat.\:com
Michael K. Johnson
.UE .
.SH "REPORTING BUGS"
Please send bug reports to
.UR procps@freelists.org
.UE

2770
man/top.1 Normal file

File diff suppressed because it is too large Load Diff

64
man/uptime.1 Normal file
View File

@@ -0,0 +1,64 @@
.\" -*-Nroff-*-
.\"
.TH UPTIME "1" "December 2012" "procps-ng" "User Commands"
.SH NAME
uptime \- Tell how long the system has been running.
.SH SYNOPSIS
.B uptime
[\fIoptions\fR]
.SH DESCRIPTION
.B uptime
gives a one line display of the following information. The current time, how
long the system has been running, how many users are currently logged on, and
the system load averages for the past 1, 5, and 15 minutes.
.PP
This is the same information contained in the header line displayed by
.BR w (1).
.PP
System load averages is the average number of processes that are either in a
runnable or uninterruptable state. A process in a runnable state is either
using the CPU or waiting to use the CPU. A process in uninterruptable state
is waiting for some I/O access, eg waiting for disk. The averages are taken
over the three time intervals. Load averages are not normalized for the
number of CPUs in a system, so a load average of 1 means a single CPU system
is loaded all the time while on a 4 CPU system it means it was idle 75% of
the time.
.SH OPTIONS
.TP
\fB\-p\fR, \fB\-\-pretty\fR
show uptime in pretty format
.TP
\fB\-h\fR, \fB\-\-help\fR
display this help text
.TP
\fB\-s\fR, \fB\-\-since\fR
system up since, in yyyy-mm-dd HH:MM:SS format
.TP
\fB\-V\fR, \fB\-\-version\fR
display version information and exit
.SH FILES
.TP
.I /var/run/utmp
information about who is currently logged on
.TP
.I /proc
process information
.SH AUTHORS
.B uptime
was written by
.UR greenfie@gauss.\:rutgers.\:edu
Larry Greenfield
.UE
and
.UR johnsonm@sunsite.\:unc.\:edu
Michael K. Johnson
.UE
.SH "SEE ALSO"
.BR ps (1),
.BR top (1),
.BR utmp (5),
.BR w (1)
.SH "REPORTING BUGS"
Please send bug reports to
.UR procps@freelists.org
.UE

235
man/vmstat.8 Normal file
View File

@@ -0,0 +1,235 @@
.\" This page Copyright (C) 1994 Henry Ware <al172@yfn.ysu.edu>
.\" Distributed under the GPL, Copyleft 1994.
.TH VMSTAT 8 "2020-06-04" "procps-ng" "System Administration"
.SH NAME
vmstat \- Report virtual memory statistics
.SH SYNOPSIS
.B vmstat
[options]
.RI [ delay " [" count ]]
.SH DESCRIPTION
.B vmstat
reports information about processes, memory, paging, block IO, traps, disks
and cpu activity.
.PP
The first report produced gives averages since the last reboot. Additional
reports give information on a sampling period of length
.IR delay .
The process and memory reports are instantaneous in either case.
.SH OPTIONS
.TP
.I delay
The
.I delay
between updates in seconds. If no
.I delay
is specified, only one report is printed with the average values since boot.
.TP
.I count
Number of updates. In absence of
.IR count ,
when
.I delay
is defined, default is infinite.
.TP
\fB\-a\fR, \fB\-\-active\fR
Display active and inactive memory, given a 2.5.41 kernel or better.
.TP
\fB\-f\fR, \fB\-\-forks\fR
The
.B \-f
switch displays the number of forks since boot. This includes the fork,
vfork, and clone system calls, and is equivalent to the total number of tasks
created. Each process is represented by one or more tasks, depending on
thread usage. This display does not repeat.
.TP
\fB\-m\fR, \fB\-\-slabs\fR
Displays slabinfo.
.TP
\fB\-n\fR, \fB\-\-one-header\fR
Display the header only once rather than periodically.
.TP
\fB\-s\fR, \fB\-\-stats\fR
Displays a table of various event counters and memory statistics. This
display does not repeat.
.TP
\fB\-d\fR, \fB\-\-disk\fR
Report disk statistics (2.5.70 or above required).
.TP
\fB\-D\fR, \fB\-\-disk-sum\fR
Report some summary statistics about disk activity.
.TP
\fB\-p\fR, \fB\-\-partition\fR \fIdevice\fR
Detailed statistics about partition (2.5.70 or above required).
.TP
\fB\-S\fR, \fB\-\-unit\fR \fIcharacter\fR
Switches outputs between 1000
.RI ( k ),
1024
.RI ( K ),
1000000
.RI ( m ),
or 1048576
.RI ( M )
bytes. Note this does not change the swap (si/so) or block (bi/bo)
fields.
.TP
\fB\-t\fR, \fB\-\-timestamp\fR
Append timestamp to each line
.TP
\fB\-w\fR, \fB\-\-wide\fR
Wide output mode (useful for systems with higher amount of memory,
where the default output mode suffers from unwanted column breakage).
The output is wider than 80 characters per line.
.TP
\fB\-y\fR, \fB\-\-no-first\fR
Omits first report with statistics since system boot.
.TP
\fB\-V\fR, \fB\-\-version\fR
Display version information and exit.
.TP
\fB\-h\fR, \fB\-\-help\fR
Display help and exit.
.PD
.SH "FIELD DESCRIPTION FOR VM MODE"
.SS
.B "Procs"
.nf
r: The number of runnable processes (running or waiting for run time).
b: The number of processes blocked waiting for I/O to complete.
.fi
.PP
.SS
.B "Memory"
These are affected by the \fB\-\-unit\fR option.
.nf
swpd: the amount of swap memory used.
free: the amount of idle memory.
buff: the amount of memory used as buffers.
cache: the amount of memory used as cache.
inact: the amount of inactive memory. (\fB\-a\fR option)
active: the amount of active memory. (\fB\-a\fR option)
.fi
.PP
.SS
.B "Swap"
These are affected by the \fB\-\-unit\fR option.
.nf
si: Amount of memory swapped in from disk (/s).
so: Amount of memory swapped to disk (/s).
.fi
.PP
.SS
.B "IO"
.nf
bi: Kibibyte received from a block device (KiB/s).
bo: Kibibyte sent to a block device (KiB/s).
.fi
.PP
.SS
.B "System"
.nf
in: The number of interrupts per second, including the clock.
cs: The number of context switches per second.
.fi
.PP
.SS
.B "CPU"
These are percentages of total CPU time.
.nf
us: Time spent running non\-kernel code. (user time, including nice time)
sy: Time spent running kernel code. (system time)
id: Time spent idle. Prior to Linux 2.5.41, this includes IO\-wait time.
wa: Time spent waiting for IO. Prior to Linux 2.5.41, included in idle.
st: Time stolen from a virtual machine. Prior to Linux 2.6.11, unknown.
gu: Time spent running KVM guest code (guest time, including guest nice).
.fi
.PP
.SH "FIELD DESCRIPTION FOR DISK MODE"
.SS
.B "Reads"
.nf
total: Total reads completed successfully
merged: grouped reads (resulting in one I/O)
sectors: Sectors read successfully
ms: milliseconds spent reading
.fi
.PP
.SS
.B "Writes"
.nf
total: Total writes completed successfully
merged: grouped writes (resulting in one I/O)
sectors: Sectors written successfully
ms: milliseconds spent writing
.fi
.PP
.SS
.B "IO"
.nf
cur: I/O in progress
s: seconds spent for I/O
.fi
.PP
.SH "FIELD DESCRIPTION FOR DISK PARTITION MODE"
.nf
reads: Total number of reads issued to this partition
read sectors: Total read sectors for partition
writes : Total number of writes issued to this partition
requested writes: Total number of write requests made for partition
.fi
.PP
.SH "FIELD DESCRIPTION FOR SLAB MODE"
.nf
cache: Cache name
num: Number of currently active objects
total: Total number of available objects
size: Size of each object
pages: Number of pages with at least one active object
.fi
.SH NOTES
.B vmstat
does not require special permissions.
.PP
These reports are intended to help identify system bottlenecks. Linux
.B vmstat
does not count itself as a running process.
.PP
All linux blocks are currently 1024 bytes. Old kernels may report blocks as
512 bytes, 2048 bytes, or 4096 bytes.
.PP
Since procps 3.1.9, vmstat lets you choose units (k, K, m, M). Default is K
(1024 bytes) in the default mode.
.PP
vmstat uses slabinfo 1.1
.SH FILES
.ta
.nf
/proc/meminfo
/proc/stat
/proc/*/stat
.fi
.SH "SEE ALSO"
.BR free (1),
.BR iostat (1),
.BR mpstat (1),
.BR ps (1),
.BR sar (1),
.BR top (1)
.PP
.SH BUGS
Does not tabulate the block io per device or count the number of system calls.
.SH AUTHORS
Written by
.UR al172@yfn.\:ysu.\:edu
Henry Ware
.UE .
.br
.UR ffrederick@users.\:sourceforge.\:net
Fabian Fr\('ed\('erick
.UE
(diskstat, slab, partitions...)
.SH "REPORTING BUGS"
Please send bug reports to
.UR procps@freelists.org
.UE

101
man/w.1 Normal file
View File

@@ -0,0 +1,101 @@
.\" -*-Nroff-*-
.\"
.TH W "1" "2020-06-04" "procps-ng" "User Commands"
.SH NAME
w \- Show who is logged on and what they are doing.
.SH SYNOPSIS
.B w
[\fIoptions\fR] [\fIuser\fR]
.SH DESCRIPTION
.B w
displays information about the users currently on the machine, and their
processes. The header shows, in this order, the current time, how long the
system has been running, how many users are currently logged on, and the
system load averages for the past 1, 5, and 15 minutes.
.PP
The following entries are displayed for each user: login name, the tty name,
the remote host, login time, idle time, JCPU, PCPU, and the command line of
their current process.
.PP
The JCPU time is the time used by all processes attached to the tty. It does
not include past background jobs, but does include currently running
background jobs.
.PP
The PCPU time is the time used by the current process, named in the "what"
field.
.SH "COMMAND\-LINE OPTIONS"
.TP
\fB\-h\fR, \fB\-\-no\-header\fR
Don't print the header.
.TP
\fB\-u\fR, \fB\-\-no\-current\fR
Ignores the username while figuring out the
current process and cpu times. To demonstrate this, do a
.B su
and do a
.B w
and a
.BR "w \-u".
.TP
\fB\-s\fR, \fB\-\-short\fR
Use the short format. Don't print the login time, JCPU or PCPU times.
.TP
\fB\-f\fR, \fB\-\-from\fR
Toggle printing the
.B from
(remote hostname) field. The default as released is for the
.B from
field to not be printed, although your system administrator or distribution
maintainer may have compiled a version in which the
.B from
field is shown by default.
.TP
\fB\-\-help\fR
Display help text and exit.
.TP
\fB\-i\fR, \fB\-\-ip\-addr\fR
Display IP address instead of hostname for \fBfrom\fR field.
.TP
\fB\-V\fR, \fB\-\-version\fR
Display version information.
.TP
\fB\-o\fR, \fB\-\-old\-style\fR
Old style output. Prints blank space for idle times less than one minute.
.TP
.B "user "
Show information about the specified user only.
.SH ENVIRONMENT
.TP
PROCPS_USERLEN
Override the default width of the username column. Defaults to 8.
.TP
PROCPS_FROMLEN
Override the default width of the from column. Defaults to 16.
.SH FILES
.TP
.I /var/run/utmp
information about who is currently logged on
.TP
.I /proc
process information
.SH "SEE ALSO"
.BR free (1),
.BR ps (1),
.BR top (1),
.BR uptime (1),
.BR utmp (5),
.BR who (1)
.SH AUTHORS
.B w
was re-written almost entirely by Charles Blake, based on the version by
.UR greenfie@\:gauss.\:rutgers.\:edu
Larry Greenfield
.UE
and
.UR johnsonm@\:redhat.\:com
Michael K. Johnson
.UE
.SH "REPORTING BUGS"
Please send bug reports to
.UR procps@freelists.org
.UE

203
man/watch.1 Normal file
View File

@@ -0,0 +1,203 @@
.TH WATCH 1 "2021-04-24" "procps-ng" "User Commands"
.SH NAME
watch \- execute a program periodically, showing output fullscreen
.SH SYNOPSIS
.B watch
[\fIoptions\fR] \fIcommand\fR
.SH DESCRIPTION
.B watch
runs
.I command
repeatedly, displaying its output and errors (the first screenfull). This
allows you to watch the program output change over time. By default,
\fIcommand\fR is run every 2 seconds and \fBwatch\fR will run until interrupted.
.SH OPTIONS
.TP
\fB\-d\fR, \fB\-\-differences\fR[=\fIpermanent\fR]
Highlight the differences between successive updates. If the optional
\fIpermanent\fR argument is specified then
.B watch
will show all changes since the first iteration.
.TP
\fB\-n\fR, \fB\-\-interval\fR \fIseconds\fR
Specify update interval. The command will not allow quicker than 0.1 second
interval, in which the smaller values are converted. Both '.' and ',' work
for any locales. The WATCH_INTERVAL environment can be used to persistently
set a non-default interval (following the same rules and formatting).
.TP
\fB\-p\fR, \fB\-\-precise\fR
Make
.BR watch
attempt to run
.I command
every
.B \-\-interval
.IR seconds .
Try it with
.B ntptime
(if present) and notice how the fractional seconds stays (nearly) the same, as opposed to
normal mode where they continuously increase.
.TP
\fB\-t\fR, \fB\-\-no\-title\fR
Turn off the header showing the interval, command, and current time at the
top of the display, as well as the following blank line.
.TP
\fB\-b\fR, \fB\-\-beep\fR
Beep if command has a non-zero exit.
.TP
\fB\-e\fR, \fB\-\-errexit\fR
Freeze updates on command error, and exit after a key press.
.TP
\fB\-g\fR, \fB\-\-chgexit\fR
Exit when the output of
.I command
changes.
.TP
\fB\-q\fR, \fB\-\-equexit\fR <cycles>
Exit when output of
.I command
does not change for the given number of cycles.
.TP
\fB\-c\fR, \fB\-\-color\fR
Interpret ANSI color and style sequences.
.TP
\fB\-x\fR, \fB\-\-exec\fR
Pass
.I command
to
.BR exec (2)
instead of
.B sh \-c
which reduces the need to use extra quoting to get the desired effect.
.TP
\fB\-w\fR, \fB\-\-no\-wrap\fR
Turn off line wrapping. Long lines will be truncated instead of wrapped to the next line.
.TP
\fB\-h\fR, \fB\-\-help\fR
Display help text and exit.
.TP
\fB\-v\fR, \fB\-\-version\fR
Display version information and exit.
.SH "EXIT STATUS"
.PP
.RS
.PD 0
.TP
.B 0
Success.
.TP
.B 1
Various failures.
.TP
.B 2
Forking the process to watch failed.
.TP
.B 3
Replacing child process stdout with write side pipe failed.
.TP
.B 4
Command execution failed.
.TP
.B 5
Closing child process write pipe failed.
.TP
.B 7
IPC pipe creation failed.
.TP
.B 8
Getting child process return value with
.BR waitpid (2)
failed, or command exited up on error.
.TP
.B other
The watch will propagate command exit status as child exit status.
.SH ENVIRONMENT
The behaviour of
.B watch
is affected by the following environment variables.
.TP
.B WATCH_INTERVAL
Update interval, follows the same rules as the
.B \-\-interval
command line option.
.SH NOTES
POSIX option processing is used (i.e., option processing stops at
the first non\-option argument). This means that flags after
.I command
don't get interpreted by
.BR watch
itself.
.SH BUGS
Upon terminal resize, the screen will not be correctly repainted until the
next scheduled update. All
.B \-\-differences
highlighting is lost on that update as well.
Non-printing characters are stripped from program output. Use \fBcat -v\fR as
part of the command pipeline if you want to see them.
Combining Characters that are supposed to display on the character at the
last column on the screen may display one column early, or they may not
display at all.
Combining Characters never count as different in
.B \-\-differences
mode. Only the base character counts.
Blank lines directly after a line which ends in the last column do not
display.
.B \-\-precise
mode doesn't yet have advanced temporal distortion technology to compensate
for a
.I command
that takes more than
.B \-\-interval
.I seconds
to execute.
.B watch
also can get into a state where it rapid-fires as many executions of
.I command
as it can to catch up from a previous executions running longer than
.B \-\-interval
(for example,
.B netstat
taking ages on a DNS lookup).
.SH EXAMPLES
.PP
To watch for mail, you might do
.IP
watch \-n 60 from
.PP
To watch the contents of a directory change, you could use
.IP
watch \-d ls \-l
.PP
If you're only interested in files owned by user joe, you might use
.IP
watch \-d 'ls \-l | fgrep joe'
.PP
To see the effects of quoting, try these out
.IP
watch echo $$
.br
watch echo '$$'
.br
watch echo "'"'$$'"'"
.PP
To see the effect of precision time keeping, try adding
.B \-p
to
.IP
watch \-n 10 sleep 1
.PP
You can watch for your administrator to install the latest kernel with
.IP
watch uname \-r
.PP
(Note that
.B \-p
isn't guaranteed to work across reboots, especially in the face of
.B ntpdate
(if present) or other bootup time-changing mechanisms)