> /dev/sdadangerRedirect output straight onto a disk device.
▸ Inspect this command in the risk checker →$ echo data > /dev/sda
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.
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.