3 ms·
You can get status on-the-fly from dd on Linux as well by sending the USR1 signal. [user@machine ~]$ dd if=/dev/zero of=/dev/null & [1] 3254428 [user@mac
by mat_epice 3y ago
You can get status on-the-fly from dd on Linux as well by sending the USR1 signal.
[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/null
- amatecha 3y agoAh, exactly the comment I was hoping to see on here as I forgot how you could query this. Thanks!
- kazinator 3y agoThis only works because you're allowing backgrounded processes to write to the terminal (stty -tostop). Try 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$
- mat_epice 3y agoI just backgrounded the process for pedagogical purposes. Usually a process I'm concerned about is running in the foreground anyway, so I signal the process from another terminal.