System and processes

The fdisk command

Views and edits a disk's partitions. With -l it shows the table without entering interactive mode.

Syntax

fdisk -l [dispositivo]

Most useful options

-lLists the partitions

Copy-ready examples

$ sudo fdisk -lSee every partition

You can try them in the browser terminal: it does not touch your computer.

Typical mistakes

  • Editing partitions can destroy data: do not do it on a disk in use without a backup.

Related commands

FAQ

fdisk or parted?

fdisk is classic and enough for basic MBR/GPT disks; parted is more modern.

Learn to actually use it

The basic Linux course takes you from zero to console fluency with 24 self-grading lessons.

Start the free course