Golden Recursion Inc. logoGolden Recursion Inc. logo
Advanced Search
Dd (Unix)

Dd (Unix)

Dd is a utility on Unix and Unix-like operating systems to convert and copy files.

Overview

"Dd" is a command-line utility for Unix and Unix-like operating systems, such as Linux. Its primary purpose is to convert and copy files; however, dd is considered a very powerful and useful utility because it can be used to do significant tasks, such as cloning disks or wiping data.

On Unix and Unix-like operating systems, device drivers for hardware, such as hard disk drives, and special device files, such as /dev/zero and /dev/random, appear in the file system just like normal files. Dd can read and write to and from these files, provided the function is implemented in their respective drivers. Dd can be used for a variety of tasks, such as backing up the boot sector of a hard drive and obtaining a fixed amount of random data. The dd utility can also perform conversions on data as it is copied, including byte order swapping and conversion to and from the ASCII and EBCDIC text encodings.

Example of a dd utility

Backing up a hard disk drive is a common example of how a dd utility can be used. A dd utility can be used to back up a copy of an entire hard disk drive to another hard disk drive connected to the same system. In this dd command example, the Unix device name of the source hard disk drive is /dev/hda, and the device name of the target hard disk drive is /dev/hdb.

Example code: # dd if=/dev/sda of=/dev/sdb

In this example, “if” represents the input file, and “of” represents the output file. Using this command, an exact copy of /dev/sda will be available in /dev/sdb.

History

The history of the command comes from an IBM job control language (JCL) dd command, where dd stood for "data definition" and was a command to attach files to a job. The command was originally developed at AT&T Bell Laboratories in the 1970s by computer scientist Ken Thompson.

Timeline

Further Resources

Title
Author
Link
Type
Date

'dd' command in Linux - GeeksforGeeks

Web

June 16, 2017

How dd command works in Linux with examples

Web

May 29, 2020

How to Use the dd Command in Linux - Make Tech Easier

Ramces Red

Web

June 23, 2022

Linux dd Command Explained for Beginners (8 Examples)

Web

References

Golden logo
By using this site, you agree to our Terms & Conditions.