Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

The buried lede here is that cat can be faster than dd: 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.



> 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


Haha 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.


Good ol' "Useless Use of Cat": http://porkmail.org/era/unix/award.html


True, 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.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: