From: Karel Zak <kzak@redhat.com>
To: Marcos Felipe Rasia de Mello <marcosfrm@gmail.com>
Cc: util-linux@vger.kernel.org
Subject: Re: lsblk "include" option?
Date: Tue, 19 Jun 2012 16:26:27 +0200 [thread overview]
Message-ID: <20120619142627.GA14727@x2.net.home> (raw)
In-Reply-To: <CAJZVDJCK3Z_u_2TYrFMdjhjNXAJgW2C9rGnwv4RdEkcca92C7Q@mail.gmail.com>
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@redhat.com>
http://karelzak.blogspot.com
next prev parent reply other threads:[~2012-06-19 14:26 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-06-15 13:09 lsblk "include" option? Marcos Felipe Rasia de Mello
2012-06-19 14:26 ` Karel Zak [this message]
2012-06-19 14:46 ` Bernhard Voelker
2012-06-19 15:43 ` Karel Zak
2012-06-19 20:48 ` Marcos Felipe Rasia de Mello
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20120619142627.GA14727@x2.net.home \
--to=kzak@redhat.com \
--cc=marcosfrm@gmail.com \
--cc=util-linux@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox