3 ms·
pv -d $(pidof xz):1 is great for when you realize too late that something is slow enough that you want a progress indication, and definitely do not want to rest
by cwillu 4y ago
pv -d $(pidof xz):1 is great for when you realize too late that something is slow enough that you want a progress indication, and definitely do not want to restart from scratch.
- xuhu 4y agoHow `pv -d` work ? Does it use perf probes or attach to the target PID ?
- remram 4y agoIt finds the file using /proc/<pid>/fd/<num> and watches its size grow. It doesn't work with pipes, devices, a file being overwritten (not appended to), or anything whose size doesn't grow.
- Jenda_ 4y agoIt does, even for reading (cat /dev/nvme0n1 > /dev/null). As per changelog: 1.5.2 - 10 February 2014 allow --watchfd to look at block devices You can see the position in /proc/<pid>/fdinfo/<num>
- cwillu 4y agoIt appears to monitor the contents of /proc/‹pid›/fdinfo/‹fd›
- dspillett 4y agoAnother good option for that, which works in a number of other useful circumstances too, is progress: https://github.com/Xfennec/progress https://github.com/Xfennec/progress