Practical Example of lsblk Command in Linux
How to List All Block Devices in Linux | lsblk Command
Understanding the storage devices connected to your Linux system is crucial for efficient system management. The lsblk
command, short for “list block devices,” is a powerful tool that provides detailed information about block devices such as hard drives, solid-state drives, and other storage-related devices. In this article, we will delve into the lsblk
command, exploring its syntax, options, and practical implementations.
In other words, Lsblk is used to display details about block devices and these block devices(Except ram disk) are basically those files that represent devices connected to the pc. It queries /sys virtual file system and udev db to obtain information that it displays. And it basically displays output in a tree-like structure. This command comes pre-installed with the util-Linux package.
Table of Content
- Installing lsblk Command in Linux
- Syntax of lsblk Command in Linux
- Options Available in lsblk Command
- Practical Example of lsblk Command in Linux
- How to List All Block Devices in Linux
- How to Display All Devices, Including Empty Ones
- How to Print sizes in bytes instead of the more human-readable formats
- How to Viewing Devices in a Tree-Like Format
- To print zone model for devices.
- To skip slave entries
- How to Invert the output, showing only non-empty devices
- To print information about device owner, group, and mode of block devices.
- How to Define the output columns to display
- To hide column headings
- To display help section of the command