Difference between revisions of "Dd"

From ArchWiki
Jump to: navigation, search
(redirect to Core_utilities#dd)
 
(Moved here from Core utilities.)
Line 1: Line 1:
#REDIRECT [[Core_utilities#dd]]
+
{{Lowercase title}}
 +
[[Category:Command-line]]
 +
[[Wikipedia:dd (Unix)|dd]] is a utility for Unix and Unix-like operating systems whose primary purpose is to convert and copy a file.
 +
 
 +
Similarly to ''cp'', by default ''dd'' makes a bit-to-bit copy of the file, but with lower-level I/O flow control features.
 +
 
 +
Some notable applications of ''dd'' are:
 +
 
 +
* [[Disk cloning#Using dd]],
 +
 
 +
* Binary file patching: let say one wants to replace offset {{ic|0x123AB}} of a file with the {{ic|FF C0 14}} hexadecimal sequence, this can be done with the command line: {{bc|1=# printf '\xff\xc0\x14' {{!}} dd seek=$((0x123AB)) conv=notrunc bs=1 of=''/path/to/file''}}
 +
 
 +
For more information see {{man|1|dd}} or the [https://www.gnu.org/software/coreutils/dd full documentation].
 +
 
 +
{{Tip|By default, ''dd'' outputs nothing until the task has finished. To monitor the progress of the operation, add the {{ic|1=status=progress}} option to the command.}}
 +
{{Warning|One should be extremely cautious using ''dd'', as with any command of this kind it can destroy data irreversibly.}}

Revision as of 08:47, 31 August 2018

dd is a utility for Unix and Unix-like operating systems whose primary purpose is to convert and copy a file.

Similarly to cp, by default dd makes a bit-to-bit copy of the file, but with lower-level I/O flow control features.

Some notable applications of dd are:

  • Binary file patching: let say one wants to replace offset 0x123AB of a file with the FF C0 14 hexadecimal sequence, this can be done with the command line:
    # printf '\xff\xc0\x14' | dd seek=$((0x123AB)) conv=notrunc bs=1 of=/path/to/file

For more information see dd(1) or the full documentation.

Tip: By default, dd outputs nothing until the task has finished. To monitor the progress of the operation, add the status=progress option to the command.
Warning: One should be extremely cautious using dd, as with any command of this kind it can destroy data irreversibly.