lsblk
disk managementLinux
The lsblk command is one of the most frequently used commands in Linux/Unix-like operating systems. lsblk List information about block devices
Quick Reference
Command Name:
lsblk
Category:
disk management
Platform:
Linux
Basic Usage:
lsblk [options] [arguments]
Common Use Cases
Syntax
lsblk [options] [device...]
Options
Option | Description |
---|---|
-a, --all |
Display all devices, including empty ones |
-b, --bytes |
Print sizes in bytes rather than human-readable format |
-d, --nodeps |
Don't print device holders or slaves (partitions) |
-e, --exclude list |
Exclude devices by major number |
-f, --fs |
Show filesystem information |
-i, --ascii |
Use ASCII characters for tree formatting |
-J, --json |
Use JSON output format |
-l, --list |
Use list format output |
-m, --perms |
Show permissions information |
-n, --noheadings |
Don't print headings |
-o, --output list |
Specify which output columns to print |
-p, --paths |
Print complete device paths |
-r, --raw |
Use raw output format |
-S, --scsi |
Output info about SCSI devices only |
-t, --topology |
Show topology information |
-x, --sort column |
Sort output by specified column |
Examples
How to Use These Examples
The examples below show common ways to use the lsblk
command. Try them in your terminal to see the results. You can copy any example by clicking on the code block.
# Basic Examples Basic
lsblk