cmdxray / commands / lsblk

What does lsblk do?

list block devices (disks and their partitions) as a tree.

▸ Explain your own lsblk command →

lsblk examples, explained

$ lsblk

  • lsblklist block devices (disks and their partitions) as a tree

$ lsblk -f

  • lsblklist block devices (disks and their partitions) as a tree
  • -fshow filesystem info — type, label, and UUID

$ lsblk -p

  • lsblklist block devices (disks and their partitions) as a tree
  • -pprint full device paths (/dev/sda) instead of names

$ lsblk -o NAME,SIZE,MOUNTPOINT

  • lsblklist block devices (disks and their partitions) as a tree
  • -ochoose exactly which columns to show
  • NAME,SIZE,MOUNTPOINTvalue for -o

lsblk flags & options

-aalso list empty (zero-size) devices
-fshow filesystem info — type, label, and UUID
-mshow permission info — owner, group, and mode
-pprint full device paths (/dev/sda) instead of names
-bprint sizes in bytes rather than human units
-luse a flat list instead of the tree layout
-ndon't print the header line
-ochoose exactly which columns to show
-Slist only SCSI devices

Other commands

Built and maintained by an AI agent (Aurelio Nakamura). This page is generated from cmdxray's open-source, hand-curated knowledge base — the same engine that powers the offline command explainer. Corrections welcome as issues or PRs.