• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer navigation

The Geek Diary

  • OS
    • Linux
    • CentOS/RHEL
    • Solaris
    • Oracle Linux
    • VCS
  • Interview Questions
  • Database
    • oracle
    • oracle 12c
    • ASM
    • mysql
    • MariaDB
  • DevOps
    • Docker
    • Shell Scripting
  • Big Data
    • Hadoop
    • Cloudera
    • Hortonworks HDP

lsblk: command not found

by admin

The lsblk command displays information about all block storage devices that are currently available on the system. The output is displayed in a tree-like format with each physical device at the top of the tree and each partition or logical volume branching off from that device. The information displayed includes names, major and minor numbers, size, device type, and mount point.

Syntax

The syntax of the lsblk command is:

# lsblk [options] [device name] lsblk COMMAND OPTIONS

The following table lists some of the options available with the lsblk command.

Option Description
-a List empty devices as well.
-e {device list} Exclude devices from output that you provide as a list of comma-separated major device numbers.
-f Output additional file system information.
-l Output results in list format.
-m Output permissions information for devices.

Here is an example of lsblk command output without any arguments passed to it.

lsblk command output

If you encounter below error while running the lsblk command:

lsblk: command not found

you may try installing below package as per your choice of distribution:

Distribution Command
OS X brew install util-linux
Debian apt-get install fdisk
Ubuntu apt-get install fdisk
Alpine apk add util-linux
Arch Linux pacman -S util-linux
Kali Linux apt-get install fdisk
CentOS yum install util-linux
Fedora dnf install util-linux
Raspbian apt-get install util-linux

lsblk Command Examples

1. List all storage devices in a tree-like format:

# lsblk

2. Also list empty devices:

# lsblk -a

3. Print the SIZE column in bytes rather than in a human-readable format:

# lsblk -b

4. Output info about filesystems:

$ lsblk -f

5. Use ASCII characters for tree formatting:

# lsblk -i

6. Output info about block-device topology:

# lsblk -t

7. Exclude the devices specified by the comma-separated list of major device numbers:

# lsblk -e 1,7

8. Display a customized summary using a comma-separated list of columns:

# lsblk --output NAME,SERIAL,MODEL,TRAN,TYPE,SIZE,FSTYPE,MOUNTPOINT

Filed Under: Linux

Some more articles you might also be interested in …

  1. How to install and Configure VNC (TigerVNC) server in CentOS / RHEL 7
  2. iw: command not found
  3. netselect Command Examples in Linux
  4. gnome-software: command not found
  5. How to configure NTP server and client in CentOS / RHEL 7
  6. How to Password Protect GRUB2 in Oracle Enterprise Linux 7
  7. fscrypt: command not found
  8. How To Migrate Existing Iptables rules to Nftables In CentOS/RHEL 8
  9. How to disable write access to USB devices using “hdparm” tool
  10. How to convert text files to all upper or lower case

You May Also Like

Primary Sidebar

Recent Posts

  • powertop Command Examples in Linux
  • powertop: command not found
  • powerstat: command not found
  • powerstat Command Examples in Linux

© 2023 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright