dd command is used in Unix and Linux systems for low-level file copy. Since everything in a Unix-like system is a file, this makes dd particularly useful for copying disks and specific blocks of data from large files.
Common system administration tasks with dd
copy or rewrite boot block on a disk
securely erase boot block, section of a disk or whole disk/partition
write ISO onto USB stick
byte-for-byte copy of a disk or disk partition
confirm a disk throughput (MB/sec capability for read/write)
Basic dd command syntax
Most commonly, you’re running the dd with the following parameters:
if – input file (or device)
of – output file (or device)
bs – block size (number of bytes or kilobytes/megabytes if you specify it like 128k or 1m)
count – number of blocks that you want to copy (if nothing specified, dd will copy the whole file or disk)
So dd command line looks like this:
Writing a disk image onto USB stick in MacOS
Disk speed with dd in Linux
Another really quick and easy way of using dd command is to indicate the disk throughput.
This example creates a 1GB file using direct I/O, thus reporting an accurate enough I/O capability of the disk under your current filesystem. 423MB/s is a sure enough sign that we are looking at an SSD and not HDD:
Know any more cool uses of dd command? Please let me know!