summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjmc <jmc@openbsd.org>2003-09-19 10:32:24 +0000
committerjmc <jmc@openbsd.org>2003-09-19 10:32:24 +0000
commite148abee4dbddf6ce956e5ed5f1489d90c9bcdec (patch)
tree5c911f6df1128caf8540ec028d3fcd1ea6153e56
parentsign fix in buffer_dump; Jedi/Sector One; pr 3473 (diff)
downloadwireguard-openbsd-e148abee4dbddf6ce956e5ed5f1489d90c9bcdec.tar.xz
wireguard-openbsd-e148abee4dbddf6ce956e5ed5f1489d90c9bcdec.zip
commands.c: add `o' and `S' to internal help, sort options
top.1: sort options and SYNOPSIS add description of `o' (from Patrick Latifi) top.c: sync usage() with SYNOPSIS ok deraadt@
-rw-r--r--usr.bin/top/commands.c9
-rw-r--r--usr.bin/top/top.1114
-rw-r--r--usr.bin/top/top.c4
3 files changed, 68 insertions, 59 deletions
diff --git a/usr.bin/top/commands.c b/usr.bin/top/commands.c
index 280a64e33a0..7a802c40364 100644
--- a/usr.bin/top/commands.c
+++ b/usr.bin/top/commands.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: commands.c,v 1.12 2003/06/20 16:53:15 deraadt Exp $ */
+/* $OpenBSD: commands.c,v 1.13 2003/09/19 10:32:24 jmc Exp $ */
/*
* Top users/processes display for Unix
@@ -74,8 +74,8 @@ show_help(void)
"These single-character commands are available:\n"
"\n"
"^L - redraw screen\n"
- "q - quit\n"
- "h or ? - help; show this text\n", stdout);
+ "h or ? - help; show this text\n"
+ "q - quit\n", stdout);
/* not all commands are available with overstrike terminals */
if (overstrike) {
@@ -91,14 +91,13 @@ show_help(void)
"I - same as 'i'\n"
"k - kill processes; send a signal to a list of processes\n"
"n or # - change number of processes to display\n", stdout);
-#ifdef ORDER
fputs(
"o - specify sort order (size, res, cpu, time)\n",
stdout);
-#endif
fputs(
"r - renice a process\n"
"s - change number of seconds to delay between updates\n"
+ "S - toggle the display of system processes\n"
"u - display processes for only one user (+ selects all users)\n"
"\n\n", stdout);
}
diff --git a/usr.bin/top/top.1 b/usr.bin/top/top.1
index e57615b0106..7579e4cdf9c 100644
--- a/usr.bin/top/top.1
+++ b/usr.bin/top/top.1
@@ -1,4 +1,4 @@
-.\" $OpenBSD: top.1,v 1.22 2003/09/02 18:50:07 jmc Exp $
+.\" $OpenBSD: top.1,v 1.23 2003/09/19 10:32:24 jmc Exp $
.\"
.\" Copyright (c) 1997, Jason Downs. All rights reserved.
.\"
@@ -31,10 +31,10 @@
.Nd display and update information about the top CPU processes
.Sh SYNOPSIS
.Nm top
-.Op Fl SbiInqu
+.Op Fl biInqSu
.Op Fl d Ar count
-.Op Fl s Ar time
.Op Fl o Ar field
+.Op Fl s Ar time
.Op Fl U Ar username
.Op Ar number
.Sh DESCRIPTION
@@ -70,10 +70,6 @@ terminal.
.Pp
The options are as follows:
.Bl -tag -width Ds
-.It Fl S
-Show system processes in the display.
-Normally, system processes such as the pager and the swapper are not shown.
-This option makes them visible.
.It Fl b
Use
.Em batch
@@ -85,6 +81,17 @@ and
.Ql ^\e )
still have an effect.
This is the default on a dumb terminal, or when the output is not a terminal.
+.It Fl d Ar count
+Show only
+.Ar count
+displays, then exit.
+A display is considered to be one update of the screen.
+This option allows the user to select the number of displays
+to be shown before
+.Nm
+automatically exits.
+For intelligent terminals, no upper limit is set.
+The default is 1 for dumb terminals.
.It Fl i
Use
.Em interactive
@@ -107,6 +114,19 @@ mode.
This is identical to
.Em batch
mode.
+.It Fl o Ar field
+Sort the process display area using the specified field as the primary key.
+The field name is the name of the column as seen in the output,
+but in lower case.
+The
+.Ox
+version of top supports
+.Ar cpu ,
+.Ar size ,
+.Ar res ,
+.Ar time ,
+and
+.Ar pri .
.It Fl q
Renice
.Nm
@@ -114,6 +134,16 @@ to -20 so that it will run faster.
This can be used when the system is
being very sluggish to improve the possibility of discovering the problem.
This option can only be used by root.
+.It Fl s Ar time
+Set the delay between screen updates to
+.Ar time
+seconds.
+The value may be fractional, to permit delays of less than 1 second.
+The default delay between updates is 5 seconds.
+.It Fl S
+Show system processes in the display.
+Normally, system processes such as the pager and the swapper are not shown.
+This option makes them visible.
.It Fl u
Do not take the time to map UID numbers to usernames.
Normally,
@@ -123,36 +153,6 @@ all the user ID numbers it encounters into login names.
This option
disables all that, while possibly decreasing execution time.
The UID numbers are displayed instead of the names.
-.It Fl d Ar count
-Show only
-.Ar count
-displays, then exit.
-A display is considered to be one update of the screen.
-This option allows the user to select the number of displays
-to be shown before
-.Nm
-automatically exits.
-For intelligent terminals, no upper limit is set.
-The default is 1 for dumb terminals.
-.It Fl s Ar time
-Set the delay between screen updates to
-.Ar time
-seconds.
-The value may be fractional, to permit delays of less than 1 second.
-The default delay between updates is 5 seconds.
-.It Fl o Ar field
-Sort the process display area using the specified field as the primary key.
-The field name is the name of the column as seen in the output,
-but in lower case.
-The
-.Ox
-version of top supports
-.Ar cpu ,
-.Ar size ,
-.Ar res ,
-.Ar time ,
-and
-.Ar pri .
.It Fl U Ar username
Show only those processes owned by
.Ar username .
@@ -238,6 +238,10 @@ Display a summary of the commands (help screen).
.It q
Quit
.Nm top .
+.El
+.Pp
+The following commands may not be available with overstrike terminals:
+.Bl -tag -width XxXXXX
.It d
Change the number of displays to show (prompt for new number).
Remember that the next display counts as one, so typing
@@ -245,38 +249,44 @@ Remember that the next display counts as one, so typing
will make
.Nm
show one final display and then immediately exit.
-.It n or #
-Change the number of processes to display (prompt for new number).
-.It s
-Change the number of seconds to delay between displays
-(prompt for new number).
+.It e
+Display a list of system errors (if any) generated by the last
+.Li kill
+or
+.Li renice
+command.
+.It i or I
+Toggle the display of idle processes.
.It k
Send a signal
.Pf ( Dv TERM
by default) to a list of processes.
This acts similarly to the command
.Xr kill 1 .
+.It n or #
+Change the number of processes to display (prompt for new number).
+.It o
+Change the sorting order of the processes
+.Pq prompt for order .
+Values are the same as for the
+.Fl o
+flag, as detailed above.
.It r
Change the priority (the
.Em nice )
of a list of processes.
This acts similarly to the command
.Xr renice 8 .
+.It s
+Change the number of seconds to delay between displays
+(prompt for new number).
+.It S
+Toggle the display of system processes.
.It u
Display only processes owned by a specific username (prompt for username).
If the username specified is simply
.Dq + ,
then processes belonging to all users will be displayed.
-.It e
-Display a list of system errors (if any) generated by the last
-.Li kill
-or
-.Li renice
-command.
-.It i or I
-Toggle the display of idle processes.
-.It S
-Toggle the display of system processes.
.El
.Sh THE DISPLAY
.\" The actual display varies depending on the specific variant of Unix
diff --git a/usr.bin/top/top.c b/usr.bin/top/top.c
index cffcd3df6b6..ea4ac0d9a3b 100644
--- a/usr.bin/top/top.c
+++ b/usr.bin/top/top.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: top.c,v 1.28 2003/08/21 08:14:50 deraadt Exp $ */
+/* $OpenBSD: top.c,v 1.29 2003/09/19 10:32:24 jmc Exp $ */
/*
* Top users/processes display for Unix
@@ -128,7 +128,7 @@ usage(void)
extern char *__progname;
fprintf(stderr,
- "usage: %s [-ISbinqu] [-d x] [-s x] [-o field] [-U username] [number]\n",
+ "usage: %s [-biInqSu] [-d count] [-o field] [-s time] [-U username] [number]\n",
__progname);
}