Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

6
  • 1
    clever! this alleviates the need to do echo test | sudo tee /tmp/foo >/dev/null to discard the output. Commented Jan 14, 2015 at 23:52
  • 2
    I may have to take that back; dd is unreliable for that unless you're using obscure GNU-only options iflag=fullblock oflag=fullblock, which remove the elegance of this answer. I'll stick with tee. Commented Jan 16, 2015 at 6:32
  • 5
    dd is reliable with the non-obscure bs=1 Commented Jan 25, 2015 at 3:50
  • 2
    @umeboshi But reliable only if you're experienced enough to know exactly what you're doing. Fordd can be fairly dangerous (if not to say: devastating) if only a slight mistake was made. So for new users, I'd rather recommend the tee method to be on the safe shore. Commented Jan 29, 2016 at 17:38
  • 1
    @AdamKatz, in the case of dd of=file alone (without count/skip...), it is reliable. iflag=fullblock is not needed because here dd writes on output what it has read on input. It doesn't matter if it was not full blocks. Commented Sep 12, 2017 at 11:30