Live data from Hacker News

The Cult of DD

eklitzke.org

21–30 of 178 posts

Re: The Cult of DD

#21
An even easier solution: don't make people fall into the command line to format a USB reliably.

The command line should be reserved for times where you need the fine grain control to do something that DD is meant to do. A GUI should implement everything else in a reliable way that doesn't break half the time or crash on unexprected input.

Re: The Cult of DD

#23

One thing I'll often use dd for is recovering data from a failing drive. Can head ignore read errors? dd can. As far as I'm concerned, dd is lower-level than most of the other utilities and provides more control over what's happening. The author does have a point that the syntax is strange though.

>One thing I'll often use dd for is recovering data from a failing drive.

Funnily enough, I ended up using it to accidentally name the wrong drive in the argument, and lost years of photos, music, video etc. though I suppose I can't blame dd for that :)

Re: The Cult of DD

#25
There's one good (?) reason to use dd with devices: it specifies target in the same command. For devices, writing to them usually requires root privileges, so it's easy to:

    sudo dd .... of=/dev/...
But there's no trivial cat equivalent:

    sudo cat ... > target
Will open target as your current user anyway. You can play around with tee and redirection of course. But that's getting more complicated than the original.

Re: The Cult of DD

#26
Somewhat related short story: Earlier this week my friend said that he dd'd away just over 50 bitcoins, back when they were worth ~$3 each.

"One of the biggest regrets of my life."

Re: The Cult of DD

#27
post #26

Somewhat related short story: Earlier this week my friend said that he dd'd away just over 50 bitcoins, back when they were worth ~$3 each. "One of the biggest regrets of my life."

If one of the biggest the biggest lifetime regrets is a $50k financial loss, your friend is doing pretty well.

Re: The Cult of DD

#28
post #3

Interesting assertion. Can you show me a shell invocation without using dd that cuts off the first 16 bytes of a binary file, for example? This is a common reason I use dd.

tail -c +17

This nearly tells you all you need to know. The other bit of info you'll want to note is that head -c +N produces as many bytes as you ask. So if you try to get the prefix using "head -c +N" and the suffix using "tail -c +N" then you'll have 1 byte of overlap.

(dd's corresponding options do not suffer from this problem.)

Re: The Cult of DD

#29
Author is wrong bs IS useful, try to dd one hard drive to another without reasonable bs (1-8M) with and without and you will see a difference.

Re: The Cult of DD

#30

Cult of pv. It looks to have more command-line complexity than dd. https://linux.die.net/man/1/pv

This is a good point as well. On BSD, we don't have `pv`, but we do have ^T. This will print some sort of status for just about any long running process. It prints very specialized status for certain programs aware of it.
Post reply on HN