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.
Here at Ibmi Media, We will look into how to use the lsblk command in Linux.
How to install the lsblk command ?
To install lsblk, simply run the below command:
$ sudo apt install util-linux
How to use lsblk command ?
1. Display block devices:
2. Display empty block devices:
$ lsblk -a
3. Display size information in bytes:
$ lsblk -b
4. Display zone model for devices:
$ lsblk -z
5. Skip slave entries:
$ lsblk -d
6. Display owner, group, mode:
$ lsblk -m
7. Display help information:
$ lsblk --help
[Need support in fixing Linux system issues ? We can help you. ]