On Fri, Jun 15, 2012 at 10:09:16AM -0300, Marcos Felipe Rasia de Mello wrote: > lsblk has an "exclude" (-e, --exclude) option. I wonder if would be > possible to add an "include" option to tell it to show *only* > specified major number devices. Like > > lsblk -i 8 Implemented (--include, -I) > to only print major number 8 devices. note that the filters (--exclude and --include) are applied to top-level devices only. For example: $ lsblk --include 8 NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT sda 8:0 0 149.1G 0 disk ├─sda1 8:1 0 1000M 0 disk /boot/efi ├─sda2 8:2 0 2G 0 disk /boot ├─sda3 8:3 0 9.7G 0 disk [SWAP] ├─sda4 8:4 0 34.2G 0 disk / ├─sda5 8:5 0 63.2G 0 disk /home └─sda6 8:6 0 39.1G 0 disk └─luks-10d813de-fa82-4f67-a86c-23d5d0e7c30e (dm-0) 253:0 0 39.1G 0 crypt /home/kzak I have a little changed --all option, it's not mutually exclusive to --include and --exclude anymore. The idea is to print all devices including empty devices (empty devices are ignored by default), for example: $ lsblk --all --include 7 NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT loop0 7:0 0 0 loop loop1 7:1 0 0 loop loop2 7:2 0 0 loop loop3 7:3 0 0 loop loop4 7:4 0 0 loop loop5 7:5 0 0 loop loop6 7:6 0 0 loop loop7 7:7 0 0 loop Karel -- Karel Zak <kzak@xxxxxxxxxx> http://karelzak.blogspot.com -- To unsubscribe from this list: send the line "unsubscribe util-linux" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html