]> git.cameronkatri.com Git - bsd-progress.git/blob - progress.1
White space nit
[bsd-progress.git] / progress.1
1 .\" $NetBSD: progress.1,v 1.9 2004/04/03 06:19:22 lukem Exp $
2 .\"
3 .\" Copyright (c) 2003,2004 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 April 3, 2004
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 .Op Fl p Ar prefix
45 .Ar cmd
46 .Op Ar args ...
47 .Sh DESCRIPTION
48 The
49 .Nm
50 utility opens a pipe to
51 .Ar cmd
52 and feeds an input stream into it, while displaying a progress bar to
53 standard output.
54 If no filename is specified,
55 .Nm
56 reads from standard input.
57 Where feasible,
58 .Nm
59 .Xr fstat 2 Ns s
60 the input to determine the length, so a time estimate can be calculated.
61 .Pp
62 If no length is specified or determined,
63 .Nm
64 simply displays a count of the data and the data rate.
65 .Pp
66 The options are as follows:
67 .Bl -tag -width XlXlengthXX
68 .It Fl f Ar file
69 Read from the specified
70 .Ar file
71 instead of standard input.
72 .It Fl l Ar length
73 Use the specified length for the time estimate, rather than attempting to
74 .Xr fstat 2
75 the input.
76 An optional suffix (per
77 .Xr strsuftoll 3 )
78 may be given.
79 .It Fl p Ar prefix
80 Print the given
81 .Dq prefix
82 text before (left of) the progress bar.
83 .It Fl z
84 Filter the input through
85 .Xr gunzip 1 .
86 If
87 .Fl f
88 is specified, calculate the length using
89 .Ic gzip -l .
90 .El
91 .Sh EXIT STATUS
92 .Nm
93 exits 0 on success.
94 .Sh EXAMPLES
95 The command
96 .Dl progress -zf file.tar.gz tar xf -
97 will extract the
98 .Pa file.tar.gz
99 displaying the progress bar as time passes:
100 .Bd -literal
101 0% | | 0 0.00 KB/s --:-- ETA
102 40% |********** | 273 KB 271.95 KB/s 00:01 ETA
103 81% |************************* | 553 KB 274.61 KB/s 00:00 ETA
104 100% |*********************************| 680 KB 264.59 KB/s 00:00 ETA
105 .Ed
106 .Pp
107 If it is preferred to monitor the progress of the decompression
108 process (unlikely), then
109 .Dl progress -f file.tar.gz tar zxf -
110 could be used.
111 .Pp
112 The command
113 .Dl dd if=/dev/rwd0d ibs=64k | \e
114 .Dl progress -l 120g dd of=/dev/rwd1d obs=64k
115 will copy the 120 GB disk
116 .Sy wd0
117 .Pa ( /dev/rwd0d )
118 to
119 .Sy wd1
120 .Pa ( /dev/rwd1d ) ,
121 displaying a progress bar during the operation.
122 .Sh SEE ALSO
123 .Xr ftp 1 ,
124 .Xr strsuftoll 3
125 .Sh HISTORY
126 .Nm
127 first appeared in
128 .Nx 1.6.1 .
129 The dynamic progress bar display code is part of
130 .Xr ftp 1 .
131 .Sh AUTHORS
132 .Nm
133 was written by
134 .An John Hawkinson
135 .Aq jhawk@NetBSD.org .
136 .Xr ftp 1 Ns 's
137 dynamic progress bar was written by Luke Mewburn.
138 .Sh BUGS
139 Since the progress bar is displayed asynchronously, it may be
140 difficult to read some error messages, both those produced by the
141 pipeline, as well as those produced by
142 .Nm
143 itself.