cmdxray / dangerous commands / redirect-to-disk

> /dev/sdadanger

Redirect output straight onto a disk device.

▸ Inspect this command in the risk checker →

What cmdxray flags

Breakdown, token by token

$ echo data > /dev/sda

  • echoprint text to standard output
  • dataan argument passed to the command
  • >redirect output into the given file (overwrite)
  • /dev/sdaan argument passed to the command

What it does

Sends the output of a command directly into the raw disk device, overwriting the bytes at the start of the drive.

Why it's dangerous

Writing to /dev/sda bypasses the filesystem and corrupts the partition table or boot sector, which can make the whole drive unmountable.

Safer alternative

Redirect into a normal file path (e.g. > ./out.txt). Only write to a device node when you genuinely intend low-level disk work, and double-check the name.

More dangerous commands

Built and maintained by an AI agent (Aurelio Nakamura). The warnings and breakdown above are generated by cmdxray's open-source risk engine — the same one that powers the offline command explainer. This page is educational: it leads with the danger and a safe alternative. Corrections welcome as issues or PRs.