22 ms·
The buried lede here is that cat can be faster than dd: https://unix.stackexchange.com/questions/9432/is-there-a-way-to-determine-the-optimal-value-for-the-bs-p
by IgorPartola 6y ago
The buried lede here is that cat can be faster than dd: https://unix.stackexchange.com/questions/9432/is-there-a-way-to-determine-the-optimal-value-for-the-bs-parameter-to-dd/9492#9492 https://unix.stackexchange.com/questions/9432/is-there-a-way...
The other important part is that cat will not have issues with binary data, which I am embarrassed to admit I assumed was not the case for the reasons stated in TFA. pv is the tool I want to use for things like copying images to SD cards but I can never remember the exact syntax needed to get it to show me the percentage since I don’t use it often. dd has a decent syntax for its command parameters and has some fun options like ability to skip, so I can quickly create large empty files.
- Aachen 6y ago> pv is the tool I want to use for things like copying images to SD cards but I can never remember the exact syntax needed to get it to show me the percentage You're in luck: the "syntax needed" is to literally not use any options: pv your.img > /dev/sdb
- IgorPartola 6y agoHaha good point. The first time I encountered pv it was in the form of like cat your.img | pv ... > /dev/sdb and then you had to tell it what size to expect and enable it showing the progress bar, etc.
- syncsynchalt 6y agoGood ol' "Useless Use of Cat": http://porkmail.org/era/unix/award.html http://porkmail.org/era/unix/award.html
- Aachen 6y agoTrue, if you pipe a data stream to it, it can't tell what the size is going to be and you'd need the --size option. The progress bar is still default, though.