# man > fdisk(8)

---
type: CommandReference
command: fdisk
mode: man
section: 8
source: man-pages
---

## Quick Reference
- `sudo fdisk -l` — list partition tables of all devices (or specified devices)
- `sudo fdisk /dev/sdX` — start interactive partition editor for `/dev/sdX`
- `m` (interactive) — display help menu
- `p` (interactive) — print the current partition table
- `n` (interactive) — create a new partition
- `d` (interactive) — delete a partition
- `w` (interactive) — write changes to disk and exit
- `q` (interactive) — quit without saving changes

## Name
fdisk — manipulate disk partition tables (MBR, GPT, BSD, Sun, SGI)

## Synopsis
shell
fdisk [options] device
fdisk -l [device...]
## Options
**Output & Listing**
- `-l, --list` — list partition tables and exit
- `-x, --list-details` — extended listing (more details than `--list`)
- `-o, --output` _list_ — specify columns to display; use `--help` for all supported columns
- `-L, --color`[=_when_] — colorize output (auto, never, always; default auto)

**Partition Table Creation & Safety**
- `-n, --noauto-pt` — do not automatically create a default partition table on an empty device
- `-B, --protect-boot` — preserve the first sector’s boot code when creating a new label (GPT and MBR)
- `-w, --wipe` _when_ — wipe filesystem/RAID/partition-table signatures (auto [interactive], never, always)
- `-W, --wipe-partitions` _when_ — wipe signatures on newly created partitions (same _when_ values)

**Disklabel & Compatibility**
- `-t, --type` _type_ — restrict to a specific disklabel type (e.g., `gpt`, `dos`, `bsd`, `sgi`, `sun`)
- `-c, --compatibility`[=_mode_] — compatibility mode: `dos` or `nondos` (default); use `-c=dos` for DOS mode
- `-u, --units`[=_unit_] — show sizes in `sectors` or `cylinders`; default sectors. Use `-u=cylinders` for DOS compatibility

**Sector & Geometry (deprecated)**
- `-b, --sector-size` _size_ — force physical/logical sector size (512, 1024, 2048, 4096)
- `-C, --cylinders` _num_ — specify number of cylinders
- `-H, --heads` _num_ — specify number of heads
- `-S, --sectors` _num_ — specify sectors per track

**Miscellaneous**
- `-s, --getsz` — print size in 512-byte sectors (deprecated; use blockdev(8))
- `-V, --version` — display version information
- `-h, --help` — display help

## See Also
- [cfdisk(8)](https://www.chedong.com/phpMan.php/man/cfdisk/8/markdown) — curses-based partition editor
- [sfdisk(8)](https://www.chedong.com/phpMan.php/man/sfdisk/8/markdown) — scripted partition table manipulation
- [partx(8)](https://www.chedong.com/phpMan.php/man/partx/8/markdown) — tell kernel about presence and numbering of partitions
- [mkfs(8)](https://www.chedong.com/phpMan.php/man/mkfs/8/markdown) — build a Linux filesystem
- [blockdev(8)](https://www.chedong.com/phpMan.php/man/blockdev/8/markdown) — call block device ioctls
- [wipefs(8)](https://www.chedong.com/phpMan.php/man/wipefs/8/markdown) — wipe signatures from a device
- [dd(1)](https://www.chedong.com/phpMan.php/man/dd/1/markdown) — convert and copy a file