Lsblk command in linux

lsblk Command in Linux

Introduction

The lsblk command in Linux allows the user to see details of block devices and these block devices (except ram disks) are files corresponding to devices connected to the computer. To get the information it displays it will query /sys virtual filesystem and udev db.

Its output will be displayed like a tree structure. Now we’re gonna introduce you to using the lsblk command in Linux. Hope you understand.

Installing lsblk command

Run apt command to install:

$ sudo apt install util-linux

Output:

Lsblk command in linux 1

Using
Sponsored
lsblk command

1. Display block devices

$ lsblk

Output:

Lsblk command in linux 2

2. Display empty block devices

$ lsblk -a

Output:

Lsblk command in linux 3

3. Display size information in bytes

$ lsblk -b

Output:

Lsblk command in linux 4

4. Display zone model for devices

Sponsored
$ lsblk -z

Output:

Lsblk command in linux 5

5. Skip slave entries

$ lsblk -d

Output:

Lsblk command in linux 6

6. Display owner, group, mode

$ lsblk -m

Output:

Lsblk command in linux 7

7. Display help information

$ lsblk --help

Output:

Lsblk command in linux 8

Conclusion

We just introduced you to how to use the lsblk command in Linux.

Thank you for reading!


Discover more from Ubuntu-Server.com

Subscribe to get the latest posts sent to your email.

Comments

No comments yet. Why don’t you start the discussion?

    Leave a Reply