Forrest logo
tool overview
On this page you find all important commands for the CLI tool lsblk. If the command you are looking for is missing please ask our AI.

lsblk

The command line tool lsblk stands for "list block devices" and is used in Linux systems. It provides a detailed overview of all the block devices such as hard drives and other storage devices connected to the system.

When you run the lsblk command without any options, it lists all the block devices in a tree-like format, showing information about each device such as device name, size, and type. It also presents the device hierarchy and relationships between devices.

lsblk displays additional information about each device by using various command options. For example, using the -a option will display all devices, even those that are hidden or inactive.

By default, lsblk only shows the physical devices and important partitions. However, it can also be used to show information about virtual devices and loopback devices by using the --all option.

The output of lsblk can be customized by using different output formats, such as JSON or CSV, by using the appropriate options.

Overall, lsblk is a useful command line tool for administrators and users to quickly access and analyze information about block devices connected to their Linux system.

List of commands for lsblk:

  • lsblk:tldr:1490c lsblk: Use ASCII characters for tree formatting.
    $ lsblk -i
    try on your machine
    explain this command
  • lsblk:tldr:28b34 lsblk: Exclude the devices specified by the comma-separated list of major device numbers.
    $ lsblk -e ${1,7}
    try on your machine
    explain this command
  • lsblk:tldr:3e041 lsblk: Display a customized summary using a comma-separated list of columns.
    $ lsblk --output ${NAME},${SERIAL},${MODEL},${TRAN},${TYPE},${SIZE},${FSTYPE},${MOUNTPOINT}
    try on your machine
    explain this command
  • lsblk:tldr:8aa2d lsblk: Print the SIZE column in bytes rather than in a human-readable format.
    $ lsblk -b
    try on your machine
    explain this command
  • lsblk:tldr:918e3 lsblk: Output info about filesystems.
    $ lsblk -f
    try on your machine
    explain this command
  • lsblk:tldr:97ca5 lsblk: Output info about block-device topology.
    $ lsblk -t
    try on your machine
    explain this command
  • lsblk:tldr:9d3de lsblk: List all storage devices in a tree-like format.
    $ lsblk
    try on your machine
    explain this command
  • lsblk:tldr:f46f8 lsblk: Also list empty devices.
    $ lsblk -a
    try on your machine
    explain this command
tool overview