blob: 5693270fc59c84aecbb897149017d3896cff0eee (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
|
.Dd 2024-05-31
.Dt STDU 1
.Sh NAME
.Nm stdu
.Nd monitor amount of data read from stdin
.Sh SYNOPSIS
.Nm stdu
.Op Fl Fl forward
.Op Fl Fl help
.Op Fl Fl human-readable
.Op Fl Fl multiline
.Op Fl Fl precision Ar n
.Nm stdu
.Op Fl hmo?
.Op Fl p Ar n
.Sh DESCRIPTION
.Nm
reads data from standard input and prints in real time the amount of data
read.
.Nm
always prints the amount of data read as precisely as specified. Thus it
has to read byte by byte (resulting to slow operation compared to reading
in chunks) if \fB--precision\fR or \fB--human-readable\fR aren't specified,
so specifying them is recommended.
.Sh OPTIONS
.Bl -tag -width 3n
.It Fl Fl forward | Fl o
Writes data read from STDIN to STDOUT and prints amount of read data
to STDERR instead of STDOUT.
.It Fl Fl help | Fl ?
Displays a help message.
.It Fl Fl human-readable | Fl h
Outputs in human-readable format. Uses binary prefixes by default
(Ki, Mi, Gi, ...). SI prefixes (K, M, G, ...) are used instead if
\fB--precision\fR is specified.
.It Fl Fl multiline | Fl m
Output with line breaks.
.Nm
outputs on one line by default.
.It Fl Fl precision Ar n | Fl p Ar n | \fB-p\fIn\fR
Output with
.Ar n
significant digits.
.Nm
may add trailing zeroes.
.El
.Sh EXAMPLES
.Nm
is useful as a progress bar replacement when transmitting large files.
.Bd -literal -offset indent
nc -l 1234 | tee backup.tar.gz | stdu -p3 -h
.Ed
.Bd -literal -offset indent
cat void-live-x86_64-musl-base.iso | stdu -ho > /dev/sdb1
.Ed
.Sh CAVEATS
.Bd -literal -offset indent
cat void-live-x86_64-musl-base.iso | sudo tee /dev/sdb1 | stdu -p3
.Ed
Is not very informative because
.Nm
probably reads the data faster from
.Xr tee 1
than /dev/sdb1 does. This is why
.Ar forward
has been implemented.
.Sh "SEE ALSO"
.Xr dd 1
.Xr du 1
.Xr progress 1
.Xr pv 1
|