39

I typed in dd in bash and ran it without double checking. Will this do anything to my system?

I just executed dd by itself. Was trying to backup a Raspberry Pi device, which I managed to do using dd. Just stupidly input and execute dd by itself afterwards.

Tom Tat
  • 429
  • 1
  • 4
  • 4

2 Answers2

66

The dd command by default will copy stdin to stdout. You either have to end it with Ctrl+D or kill it with Ctrl+C.

So, it would not have made any harm, unless you have redirected its input or output.

See http://manpages.ubuntu.com/manpages/latest/en/man1/dd.1.html for more information.

FedKad
  • 9,212
  • 7
  • 40
  • 79
7

dd stands for data dump. Called so, because it only dumps the data passed to it without any processing. Without an if (input file) parameter (or being "piped"), it would wait for some input that is terminated at the end with EOT (end of transmission) which you would do with CTRL + D. You could also CTRL + C (abort the input) and no data will be written. That being said, if you don't give it any input (it would simply write nothing), or abort the command before you ended the input, there surely can't be any harm done.

On another note, if you didn't supply an of (output file) parameter (or "pipe" it to some other command afterwards), it will only print the input data.

So, it is safe to say that it didn't change anything on your system.

You could also read the manual with man dd, as well.

GGets
  • 171
  • 4
  • 6
    Actually, `dd` can do a lot of processing to the data passed to it. It can convert lower to upper case or vice versa, or between ASCII and EBCDIC (including an alternate EBCDIC that IBM used), it can "block" and "unblock" data, by adding or removing blank-space or NUL padding for newline-terminated records, it can swap the order of byte pairs (useful for 16-bit little-to-big-endian or vice versa conversions). – Monty Harder Dec 04 '19 at 23:27
  • 1
    Sometimes `dd` stands for "data destroyer". In particular when one writes an image to a wrong device. – Kamil Maciorowski Dec 05 '19 at 18:32