Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Use the lsblk command of linux to view the disk of the system

2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/02 Report--

Editor to share with you the use of linux lsblk command to view the disk of the system, I believe that most people do not know much, so share this article for you to learn, I hope you will learn a lot after reading this article, let's go to learn the method!

The English name of the lsblk command is "list block", which lists information about all available block devices and also shows the dependencies between them, but it does not list information about RAM disks.

The lsblk command is included in the util-linux-ng package, which is now renamed util-linux.

Syntax format: lsblk [parameters]

Common parameters:

-a display all devices-b display device size in bytes mode-d do not display slaves or holders-Dprint discard capabilities-e exclude devices-f display file system information-h display help information-iuse ascii characters only-m display permissions information-l display using list format display-n do not display title-o output column-P display in key= "value" format-r display in original format-t display topology information

Reference example

The lsblk command lists all block devices in a tree by default:

[root@linuxcool ~] # lsblk

Lsblk NAME MAJ:MIN rm SIZE RO type mountpoint

Sda 8:0 0 232.9G 0 disk

├─ sda1 8:1 0 46.6G 0 part /

├─ sda2 8:2 0 1K 0 part

├─ sda5 8:5 0 190M 0 part / boot

├─ sda6 8:6 0 3.7G 0 part [SWAP]

├─ sda7 8:7 0 93.1G 0 part / data

└─ sda8 8:8 0 89.2G 0 part / personal

Sr0 11:0 1 1024M 0 rom

The default option does not list all empty devices:

[root@linuxcool] # lsblk-a

It can also be used to list the ownership relationships for a particular device, as well as groups and patterns:

[root@linuxcool] # lsblk-m

To get a list of SCSI devices, you can only use the-S option, which is used to print dependencies in reverse order:

[root@linuxcool] # lsblk-S

For example, you might want to list devices in a list format instead of the default tree format. You can combine two different options to get the desired output:

[root@linuxcool ~] # lsblk-nl above is to use the lsblk command of linux to view all the contents of the disk of the system, thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report