• Skip to main content

Uly.me

cloud engineer

  • Home
  • About
  • Archives

Filter Output of LSBLK

November 20, 2020

Here’s one way to display block devices, mountpoints and size using lsblk.

lsblk -a -p -n -d -e 230 -o NAME,MOUNTPOINT,SIZE

lsblk -a -p -n -d -e 230 -o NAME,MOUNTPOINT,SIZE

Here are the options.

  • -a = list all empty devices
  • -p = print full device paths
  • -d = do not print holder devices or slaves
  • -e = exclude devices as by a comma-separate list
  • -o = specify which columns to print, e.g. NAME,MOUNTPOINT,SIZE

The output.

/dev/sda             30G
/dev/sdb /data       50G

/dev/sda 30G /dev/sdb /data 50G

Here’s the man page.

Filed Under: Linux Tagged With: block, device, list, lsblk

Search This Website

Subscribe Via Email

  • Home
  • About
  • Archives

Copyright © 2023