]> git.cameronkatri.com Git - bsd-progress.git/blob - progress.1
not all windows have 80 columns.
[bsd-progress.git] / progress.1
1 .\" $NetBSD: progress.1,v 1.2 2003/01/22 02:58:16 lukem Exp $
2 .\"
3 .\" Copyright (c) 2003 The NetBSD Foundation, Inc.
4 .\" All rights reserved.
5 .\"
6 .\" This code is derived from software contributed to The NetBSD Foundation
7 .\" by John Hawkinson.
8 .\"
9 .\" Redistribution and use in source and binary forms, with or without
10 .\" modification, are permitted provided that the following conditions
11 .\" are met:
12 .\" 1. Redistributions of source code must retain the above copyright
13 .\" notice, this list of conditions and the following disclaimer.
14 .\" 2. Redistributions in binary form must reproduce the above copyright
15 .\" notice, this list of conditions and the following disclaimer in the
16 .\" documentation and/or other materials provided with the distribution.
17 .\" 3. Neither the name of The NetBSD Foundation nor the names of its
18 .\" contributors may be used to endorse or promote products derived
19 .\" from this software without specific prior written permission.
20 .\"
21 .\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
22 .\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
23 .\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
24 .\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
25 .\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
26 .\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
27 .\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
28 .\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
29 .\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
30 .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
31 .\" POSSIBILITY OF SUCH DAMAGE.
32 .\"
33 .Dd January 21, 2003
34 .Dt PROGRESS 1
35 .Os
36 .Sh NAME
37 .Nm progress
38 .Nd feed input to a command, displaying a progress bar
39 .Sh SYNOPSIS
40 .Nm
41 .Op Fl z
42 .Op Fl f Ar file
43 .Op Fl l Ar length
44 .Ar cmd
45 .Op Ar args ...
46 .Sh DESCRIPTION
47 The
48 .Nm
49 utility opens a pipe to
50 .Ar cmd
51 and feeds an input stream into it, while displaying a progress bar to
52 standard output.
53 If no filename is specified,
54 .Nm
55 reads from standard input.
56 Where feasible,
57 .Nm
58 .Xr fstat 2 Ns s
59 the input to determine the length, so a time estimate can be calculated.
60 .Pp
61 If no length is specified or determined,
62 .Nm
63 simply displays a count of the data and the data rate.
64 .Pp
65 The options are as follows:
66 .Bl -tag -width XlXlengthXX
67 .It Fl f Ar file
68 Read from the specified
69 .Ar file
70 instead of standard input.
71 .It Fl l Ar length
72 Use the specified length for the time estimate, rather than attempting to
73 .Xr fstat 2
74 the input.
75 .It Fl z
76 Filter the input through
77 .Xr gzip 1 .
78 If
79 .Fl f
80 is specified, calculate the length using
81 .Ic gzip -l .
82 .El
83 .Sh EXIT STATUS
84 .Nm
85 exits 0 on success.
86 .\" .Sh ENVIRONMENT
87 .\" .Sh FILES
88 .Sh EXAMPLES
89 The command
90 .Ic progress -zf file.tar.gz tar xf -
91 will extract the
92 .Pa file.tar.gz
93 displaying the progress bar as time passes:
94 .Bd -literal
95 0% | | 0 0.00 KB/s --:-- ETA
96 40% |********** | 273 KB 271.95 KB/s 00:01 ETA
97 81% |************************* | 553 KB 274.61 KB/s 00:00 ETA
98 100% |*********************************| 680 KB 264.59 KB/s 00:00 ETA
99 .Ed
100 .Pp
101 If it is preferred to monitor the progress of the decompression
102 process (unlikely), then
103 .Ic progress -f file.tar.gz tar zxf -
104 could be used.
105 .\".Sh DIAGNOSTICS
106 .Sh SEE ALSO
107 .Xr ftp 1
108 .\" .Sh STANDARDS
109 .Sh HISTORY
110 .Nm
111 first appeared in
112 .Nx 1.6.1 .
113 The dynamic progress bar display code is part of
114 .Xr ftp 1 .
115 .Sh AUTHORS
116 .Nm
117 was written by
118 .An John Hawkinson Aq jhawk@NetBSD.ORG .
119 .Xr ftp 1 Ns 's
120 dynamic progress bar was written by Luke Mewburn.
121 .Sh BUGS
122 Since the progress bar is displayed asynchronously, it may be
123 difficult to read some error messages, both those produced by the
124 pipeline, as well as those produced by
125 .Nm
126 itself.
127 .Pp
128 Under special circumstances,
129 .Nm
130 may have its output pipe prematurely closed.
131 For example:
132 .Bd -literal
133 # < /dev/zero progress dd of=/dev/null
134 26923 KB 26.19 MB/s progress: wrote -1 of 512 bytes to output pipe: Bad address
135 # 53847+0 records in
136 53847+0 records out
137 27569664 bytes transferred in 0.997 secs (27652621 bytes/sec)
138 .Ed
139 .\" .Sh SECURITY CONSIDERATIONS