Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

How to redirect output from dd command to /dev/null ?

share|improve this question

2 Answers 2

If you want to redirect the data output, use the of argument:

dd if=/dev/urandom of=/dev/null count=1

If you want to redirect both the data output and the progress messages:

dd if=/dev/urandom count=1 >/dev/null 2>&1

If you want to save the data and throw away the messages:

dd if=/dev/urandom of=output_file count=1 2>/dev/null

In these examples /dev/urandom and the count argument are simply being used for demonstration.

share|improve this answer

By default dd sends what it read from if to stdout, but usually (always?) one wants to redirect it to a file. Use the of parameter for that.

dd if=from of=to

So you want to replace to with /dev/null.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.