←back to thread

172 points lnyan | 7 comments | | HN request time: 0.213s | source | bottom
1. 6c696e7578 ◴[] No.42198530[source]
A little more typing, but I find dd present on most systems already, so I tend to do this:

  tar ... | dd status=progress | ...
replies(4): >>42198684 #>>42198757 #>>42200618 #>>42201324 #
2. Aachen ◴[] No.42198684[source]
I've used pv longer than dd had this option for, but that's fair! I also don't use find options, for example, since find piped into the tool everyone already knows anyway - grep - is much easier

Sadly, dd will not give you an estimated time or allow you to limit the transfer rate, which are two features I use a lot in pv

3. fuzztester ◴[] No.42198757[source]
dd conv=swab is a cool and useful option. swab stands for swap bytes, iirc. guess what it is used for, those who don't already know.
replies(1): >>42199256 #
4. codetrotter ◴[] No.42199256[source]
> guess what it is used for, those who don't already know.

Changing the endianness of the data?

replies(1): >>42200139 #
5. fuzztester ◴[] No.42200139{3}[source]
Exactly!

That's just what I used it for, early in my career, in a software troubleshooting case.

I was a newbie dev, tasked with converting some data from another machine / OS format on tape to a Unix machine format.

Was fairly new to Unix too.

Looked through man pages, found dd, could read and copy the data from tape drive to disk using it. But the data, while in ASCII, and English letters, seemed garbled. Seemed like actual words, but not quite, if you know what I mean. Something seemed off a bit.

I puzzled over it for a while, then checked the dd man page again. I saw the conv=swab option and its meaning, which is to swap adjacent bytes. (Typical Unix cryptic syntax, and I say that as a long term Unix guy). I probably was new to endianess at that time. This was in a pre-Internet time, so I could not google to check what endianness meant.

I added that option to my dd command line, and what was my shock and pleasure to see all the words coming out as proper English words, now, on the screen!

Then I knew that the tape contained actual data, not garbage. I saved it to disk under some file name.

Job done.

6. flyinghamster ◴[] No.42200618[source]
One problem I've noticed with status=progress is that systems can sometimes have gigabytes of buffer space waiting to be filled, so the transfer spends most of its time in a "nearly done" state while (for instance) the SD card gets slowly filled at its real speed.
7. fulafel ◴[] No.42201324[source]
That's slowish, bottlenecking disk based IO. (yes you can improve it with dd options, if you are versed in the language...)