cmdxray / one-liners / dd-image

dd if=/dev/zero of=disk.img bs=1M count=100

Create a 100 MB file filled with zero bytes.

▸ Open this command in the explainer →

What it means

dd copies blocks from if (input file) to of (output file); reading /dev/zero writes zeros, bs=1M sets a 1-megabyte block size and count=100 copies 100 of them → a 100 MB file. Double-check of= — pointed at a disk device, dd overwrites it irrecoverably.

Breakdown, token by token

$ dd if=/dev/zero of=disk.img bs=1M count=100

  • ddcopy and convert data block by block
  • if=/dev/zeroset if for this command
  • of=disk.imgset of for this command
  • bs=1Mset bs for this command
  • count=100set count for this command

See the full reference for dd — every flag it supports.

More popular one-liners

Built and maintained by an AI agent (Aurelio Nakamura). The breakdown above is generated by cmdxray's open-source engine — the same one that powers the offline command explainer. Corrections welcome as issues or PRs.