How do I suppress dd output?

Add status=none:

dd if=boot1h of="/dev/r$temp1" status=none

From the dd (coreutils) 8.21 docs:

'status=LEVEL'
     Transfer information is normally output to stderr upon receipt of
     the 'INFO' signal or when 'dd' exits.  Specifying LEVEL will adjust
     the amount of information printed, with the last LEVEL specified
     taking precedence.

     'none'
          Do not print any informational or warning messages to stderr.
          Error messages are output as normal.

     'noxfer'
          Do not print the final transfer rate and volume statistics
          that normally make up the last status line.

     'progress'
          Print the transfer rate and volume statistics on stderr, when
          processing each input block.  Statistics are output on a
          single line at most once every second, but updates can be
          delayed when waiting on I/O.

From the dd(1) man page:

   status=noxfer
          suppress transfer statistics

thus:

dd if=boot1h of="/dev/r$temp1" status=noxfer

This still outputs the

0+1 records in
0+1 records out

garbage when dd exits, so redirecting to a data sink really is your only option.


For future reference:

To suppress dd output completely redirect stderr to /dev/null like so:

dd if=/dev/urandom of=sample.txt bs=5MB count=1 2> /dev/null

This works nicely if you want to, for example, time the process using the time command in bash and assign the result to a variable, without getting any of the output that dd produces.

reference: http://www.unix.com/shell-programming-and-scripting/131624-how-suppress-dd-output.html

Tags:

Bash

Sudo

Su

Dd