HiveBrain v1.2.0
Get Started
← Back to all entries
snippetbashTip

lsblk — List information about devices. More information: <https://manned.org/lsblk>.

Submitted by: @import:tldr-pages··
0
Viewed 0 times
lsblkcommanddevicescliinformationaboutmorelist
linux

Problem

How to use the lsblk command: List information about devices. More information: <https://manned.org/lsblk>.

Solution

lsblk — List information about devices. More information: <https://manned.org/lsblk>.

List all storage devices in a tree-like format:
lsblk


Also list empty devices:
lsblk {{[-a|--all]}}


Print the SIZE column in bytes rather than in a human-readable format:
lsblk {{[-b|--bytes]}}


Output info about filesystems:
lsblk {{[-f|--fs]}}


Use ASCII characters for tree formatting:
lsblk {{[-i|--ascii]}}


Output info about block-device topology:
lsblk {{[-t|--topology]}}


Exclude the devices specified by the comma-separated list of major device numbers:
lsblk {{[-e|--exclude]}} {{1,7,...}}


Add extra information to the output using a comma-separated list of columns (omit the + sign to only display the specified columns):
lsblk {{[-o|--output]}} +{{NAME,ROTA,SERIAL,MODEL,TRAN,TYPE,SIZE,FSTYPE,MOUNTPOINT,...}}

Code Snippets

List all storage devices in a tree-like format

lsblk

Also list empty devices

lsblk {{[-a|--all]}}

Print the SIZE column in bytes rather than in a human-readable format

lsblk {{[-b|--bytes]}}

Output info about filesystems

lsblk {{[-f|--fs]}}

Use ASCII characters for tree formatting

lsblk {{[-i|--ascii]}}

Context

tldr-pages: linux/lsblk

Revisions (0)

No revisions yet.