% stty status '^t'
btw, for Linux dd(1) I know about "status=progress", but for me it is a bit hard to remember and specific to dd(1). But, nice little utility :)
% stty status '^t'
btw, for Linux dd(1) I know about "status=progress", but for me it is a bit hard to remember and specific to dd(1). But, nice little utility :)
dd if=<input> | pv | dd of=<output>
to get a count of bytes passing through, or pv <input> | dd of=<output>
to get actual completion progress. For tarchives, pv <tarchive> | tar x
Compression progress pv <file> | bzip2 > <file>.bz2tar c foo | pv | gzip | socat - tcp-listen:9999
socat tcp:bar:9999 - | pv > foo.tar.gz
If pv shows that you aren’t saturating your network and are cpu limited, replace gzip with lzop. If vice versa, replace gzip with something more aggressive.
tar c foo | pv -cN raw | gzip | pv -cN compressed | whatever else
It’s handy to see multiple progress bars at once.
Try
cp $BIGFILE ${BIGFILE}_1 & pv --watchfd $(pidof cp)
[user@machine ~]$ dd if=/dev/zero of=/dev/null &
[1] 3254428
[user@machine ~]$ kill -USR1 %1
19061394+0 records in
19061393+0 records out
9759433216 bytes (9.8 GB, 9.1 GiB) copied, 6.06968 s, 1.5 GB/s
[user@machine ~]$ kill -USR1 %1
25868762+0 records in
25868762+0 records out
13244806144 bytes (13 GB, 12 GiB) copied, 8.97352 s, 1.5 GB/s
[user@machine ~]$ kill %1
[1]+ Terminated dd if=/dev/zero of=/dev/nullTry stty tostop
kaz@sun-go:~/txr$ stty -tostop
kaz@sun-go:~/txr$ dd if=/dev/zero of=/dev/null &
[1] 14604
kaz@sun-go:~/txr$ kill -USR1 %1
kaz@sun-go:~/txr$ 1142200+0 records in
1142200+0 records out
584806400 bytes (585 MB, 558 MiB) copied, 2.62053 s, 223 MB/s
kaz@sun-go:~/txr$ kill -USR1 %1
2054884+0 records in
2054883+0 records out
1052100096 bytes (1.1 GB, 1003 MiB) copied, 4.70066 s, 224 MB/s
kaz@sun-go:~/txr$
kaz@sun-go:~/txr$ stty tostop
kaz@sun-go:~/txr$ kill -USR1 %1
kaz@sun-go:~/txr$ kill -USR1 %1
[1]+ Stopped dd if=/dev/zero of=/dev/null
kaz@sun-go:~/txr$ kill -USR1 %1
[1]+ Stopped dd if=/dev/zero of=/dev/null
kaz@sun-go:~/txr$Inevitably it turns out my idea was not as useful as it seemed when it first popped in my head, so after a few weeks/months that Pi is turned off and returned to the pi drawer.... ready for the next brilliant idea.
(ps. I typically use the `pv` command to see progress with stuff other than dd)
Love that philosophy of keeping an inventory (recycled in this case) of Raspberry Pi’s !
Do you buy a Pi when first starting a project?
The nice thing with ^T versus status=progress is that ^T will work even when dd was invoked from some script that you don't necessarily want to edit, etc.
I first came to love it learning how to fix my bootloader and undo all sorts of horrible things I'd done to my system when I was a teenager exploring Linux well over a decade ago. I also worked in repair for a while and there it was indispensable for data recovery purposes along with its cousin ddrescue.
Now I just use it for my constant tinkering needs.
dd conv=sparseWhy does it matter? Use `bs=$((4 * 1024 * 1024))`. It'll work perfectly for any imaginable block size.
My issue with dd is that it's possible to write corrupted data with some weird flags which I did once. Something with conv=sync I believe which does unexpected things. But if you're not trying to be too smart, dd works fine.
Meanwhile, the Linux kernel has removed Shift-PgUp scrollback from the console.
* https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux...
There's already kmscon but I haven't looked closely into what prevented that transition from moving forward as the default. Presumably there's a bunch of edge cases a kernel based console doesn't suffer from, like having to avoid oom killer or getting paged out/becoming unresponsive on systems falling over etc.
The console process will have to be something exceptionally configured, pinned memory, realtime priority, oom-immune, all that jazz.
* https://jdebp.uk/Proposals/linux-console-daemon.html
What happened to kmscon is that the systemd people, having adopted it with much hullabaloo, dropped it a while later with far less fanfare.
That said, there are a range of options for people who want to build Linux without CONFIG_VT.
* https://jdebp.uk/Softwares/nosh/user-vt-screenshots.html
* https://jdebp.uk/Softwares/nosh/guide/user-virtual-terminals...
(-:
UNIX-like is not a convention of UNIX - it's a convention of "we didn't get to making that useful thing yet, there's other stuff to do."
Similarly you could alias rsync instead of copy and move:
alias pcp='rsync -au --info=progress2'
alias pmv='rsync -aP --info=progress2 --remove-source-files' status=LEVEL
The LEVEL of information to print to stderr; 'none'
suppresses everything but error messages, 'noxfer'
suppresses the final transfer statistics, 'progress' shows
periodic transfer statistics
and pv pv - monitor the progress of data through a pipe
So with pv, you can do something like dd if=/dev/zero count=2 bs=512 | pv | dd of=/dev/null
to visualize your dd progress.I recall I started using ddrescue because one of my distros would not autocomplete with the if= prefix, but I can't seem to replicate it currently - so it's probably been fixed (or my memory is failing me).
Info defaults to dumping generic stuff, it’s completely safe (unless a dev decided to handle it by dying but I would not want to use their software).