Difference between revisions of "Dd"

From ArchWiki
Jump to: navigation, search
(Moved here from Core utilities.)
(Add installation.)
Line 4: Line 4:
  
 
Similarly to ''cp'', by default ''dd'' makes a bit-to-bit copy of the file, but with lower-level I/O flow control features.
 
Similarly to ''cp'', by default ''dd'' makes a bit-to-bit copy of the file, but with lower-level I/O flow control features.
 +
 +
== Installation ==
 +
 +
dd is included in the GNU {{Pkg|coreutils}} package. For other utilities in the package, please refer to [[Core utilities]].
 +
 +
== Usage ==
  
 
Some notable applications of ''dd'' are:
 
Some notable applications of ''dd'' are:

Revision as of 08:49, 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.

Installation

dd is included in the GNU coreutils package. For other utilities in the package, please refer to Core utilities.

Usage

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.