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