lsblk
List information about block devices
TLDR
Show the block devices as a tree
$ lsblk
Show filesystem type, label, UUID and mountpoint$ lsblk --fs
Print full device paths as a flat list$ lsblk --paths --list
Choose exactly the columns you want$ lsblk --output NAME,SIZE,TYPE,FSTYPE,MOUNTPOINTS
Add columns to the default set$ lsblk --output +SERIAL,MODEL
Show every available column$ lsblk --output-all
Emit JSON$ lsblk --json
Emit key=value pairs that a shell can read$ lsblk --pairs --output NAME,FSTYPE,UUID
Print sizes in exact bytes$ lsblk --bytes
Show one device without its partitions$ lsblk --nodeps /dev/sda
Hide the loop devices that snap packages create$ lsblk --exclude 7
Show owner, group and mode of each device node$ lsblk --perms
Show queue topology, including sector sizes$ lsblk --topology
Show which devices support discard (TRIM)$ lsblk --discard
Show a partition's parents instead of its children$ lsblk --inverse /dev/sda1
SYNOPSIS
lsblk [-a] [-b] [-f] [-t] [-o columns] [device...]
DESCRIPTION
lsblk lists information about all available or specified block devices. It reads the sysfs filesystem and udev database to gather information and displays it in a tree-like format showing the relationship between devices and partitions.
PARAMETERS
-a, --all
Also list empty devices-b, --bytes
Print SIZE column in bytes-f, --fs
Output info about filesystems (FSTYPE, LABEL, UUID, MOUNTPOINT)-t, --topology
Output block device topology information-i, --ascii
Use ASCII characters for tree formatting-l, --list
Produce output in list format-o, --output columns
Specify which columns to output-e, --exclude list
Exclude devices by major device numbers-n, --noheadings
Don't print column headings-p, --paths
Print full device paths-d, --nodeps
Don't print holder devices or slaves (show only top-level devices)-J, --json
Output in JSON format-S, --scsi
Output SCSI device information-r, --raw
Use raw output format
AVAILABLE COLUMNS
NAME, KNAME, MAJ:MIN, FSTYPE, MOUNTPOINT, LABEL, UUID, SIZE, MODEL, SERIAL, TYPE, TRAN, RO, RM, HOTPLUG, ROTA
INSTALL
sudo apt install util-linux
sudo dnf install util-linux
sudo pacman -S util-linux
sudo apk add lsblk
sudo zypper install util-linux
brew install util-linux
nix profile install nixpkgs#util-linux
CAVEATS
Some information may require root privileges. Mounted filesystems show mount points; unmounted show blank.
HISTORY
Part of util-linux package. Provides a more readable alternative to /proc/partitions and fdisk -l.
