fdisk

Partition table manipulator

high risk

interactive breakdown — edit the command and press Explain
$ 
⚠ Risks & cautions
Safer / dry-run alternatives
sfdisk -d /dev/sdX > sdX.ptBack up the partition table
lsblk -fVerify which device is which
What it does

Interactive tool to create/delete partitions on MBR/GPT disks. Changes are written only when you press w.

Common flags
FlagMeaning
-lList partitions (read-only)
-uShow sizes in sectors
Examples
fdisk -lList all partitions · explain & risk-check →
fdisk /dev/sdbEdit /dev/sdb (interactive) · explain & risk-check →
Related
parted lsblk mkfs
Open the full explainer →More in Disks & Filesystems

Reference text is hand-written and may be incomplete — check man fdisk for your version. Test destructive commands on a non-production system first.