Categories: TutorialsUbuntu

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:

Using
Sponsored
lsblk command

1. Display block devices

$ lsblk

Output:

2. Display empty block devices

$ lsblk -a

Output:

3. Display size information in bytes

$ lsblk -b

Output:

4. Display zone model for devices

Sponsored
$ lsblk -z

Output:

5. Skip slave entries

$ lsblk -d

Output:

6. Display owner, group, mode

$ lsblk -m

Output:

7. Display help information

$ lsblk --help

Output:

Conclusion

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

Thank you for reading!

Karim Buzdar holds a degree in telecommunication engineering and holds several sysadmin certifications including CCNA RS, SCP, and ACE. As an IT engineer and technical author, he writes for various websites.

Ubuntu Server Admin

Recent Posts

Welcome to the Ubuntu Weekly Newsletter 883

Welcome to the Ubuntu Weekly Newsletter, Issue 883 for the week of March 9 –…

20 hours ago

How to Install nvidia-smi on Ubuntu or Debian Linux

In this article, we will see how to install nvidia-smi on Ubuntu or Debian Linux.…

1 day ago

How to Install clang tool on Ubuntu or Debian Linux

In this article, we will see how to install clang tool on Ubuntu or Debian…

2 days ago

How to resolve Ubuntu 20.04 Container Signature Errors on Raspberry Pi ARM Devices

When working with Docker containers on Raspberry Pi devices, you might encounter frustrating signature verification…

3 days ago

How to fix DNS Resolution Issues with OpenVPN on Ubuntu 18.04

You’ve recently upgraded to Ubuntu 18.04 and found that your OpenVPN connection no longer resolves…

3 days ago

How to Fix Ubuntu 18.04 System Monitor Launch Issues

Have you ever tried to open System Monitor on your Ubuntu 18.04 system only to…

4 days ago