What happens if you run dd without any argument

bashterminal

I was working with Terminal then suddenly I thought of running dd without any arguments. Then it started doing something then I immediately started doing something. I got scared so I aborted it using ^C.

Output of dd:

$ dd
0+0 records in
0+0 records out
0 bytes transferred in 2.556354 secs (0 bytes/sec)
$ 

Best Answer

dd is a "stream duplicator".

Using dd with no operands means it will be reading and writing to the standard input/output (keyboard and screen).

From the man page (man dd)

The dd utility copies the standard input to the standard output.

So, issuing the command dd and then sending a break ControlC results in nothing being input, and nothing being written. Until you sent the break, dd was waiting for input.

Here are some examples (press ControlD to tell dd you are done entering text)

$ dd
Hello, World

results in

$ dd
Hello, World
Hello, World
0+1 records in
0+1 records out
13 bytes transferred in 6.140313 secs (2 bytes/sec)

To convert from regular to upper/lowercase:

$ dd conv=ucase
Hello, World
HELLO, WORLD

dd conv=lcase
Hello World
hello world