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

AI in 2025: is it an agentic year?

2024 was the GenAI year. With new and more performant LLMs and a higher number…

10 hours ago

Canonical announces 12 year Kubernetes LTS

Canonical’s Kubernetes LTS (Long Term Support) will support FedRAMP compliance and receive at least 12…

1 day ago

Ubuntu Weekly Newsletter Issue 878

Welcome to the Ubuntu Weekly Newsletter, Issue 878 for the week of February 2 –…

2 days ago

How your feedback shapes the way we support open source software

At Canonical, we firmly believe that delivering an outstanding, customer-centric support experience is impossible without…

2 days ago

How To Install osTicket v1.14 On Ubuntu 20.04

I want to share how to install osTicket v1.14 for Ubuntu 20.04 server. osTicket written…

4 days ago

How To Install WordPress On Ubuntu 20.04

Now I want to share how to install WordPress on ubuntu 20.04 server. WordPress is…

4 days ago