commands.sh

lsblk

linux

List information about devices.

More info →

Options (7)

-a, --allboolean

Also list empty devices

Example: lsblk {{[-a|--all]}}
-b, --bytesboolean

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

Example: lsblk {{[-b|--bytes]}}
-f, --fsboolean

Output info about filesystems

Example: lsblk {{[-f|--fs]}}
-i, --asciiboolean

Use ASCII characters for tree formatting

Example: lsblk {{[-i|--ascii]}}
-t, --topologyboolean

Output info about block-device topology

Example: lsblk {{[-t|--topology]}}
-e, --excludeboolean

Exclude the devices specified by the comma-separated list of major device numbers

Example: lsblk {{[-e|--exclude]}} {{1,7,...}}
-o, --outputboolean

Add extra information to the output using a comma-separated list of columns (omit the `+` sign to only display the specified columns)

Example: lsblk {{[-o|--output]}} +{{NAME,ROTA,SERIAL,MODEL,TRAN,TYPE,SIZE,FSTYPE,MOUNTPOINT,...}}

Examples (8)

List all storage devices in a tree-like format

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,...
made by @shridhargupta | data from tldr-pages