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

How to use the lsblk command of Linux

2025-02-28 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

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

This article mainly explains "how to use the lsblk command of Linux". The content of the explanation is simple and clear, and it is easy to learn and understand. Please follow the editor's train of thought to study and learn how to use the lsblk command of Linux.

The common Linux command lsblk command is called "list block", which is used to list information about all available block devices and also shows the dependencies between them, but it does not list information about RAM disks.

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 topology information in original format-t

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 sda8: 0 0232.9G 0 disk sda1 8:1 0 46.6G 0 part / ├─ sda2 8:2 0 1K 0 part ├─ sda5 8:5 0190M 0 part / boot ├─ sda6 8:6 03.7G 0 part [SWAP] ├─ sda7 8:7 093.1G 0 part / data └─ sda8 8:8 0 89.2G 0 part / personal sr0 11:0 1 1024M 0 rom default option does not list all empty devices:

[root@linuxcool ~] # lsblk-a can also be used to list the ownership relationships of a specific 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 Thank you for your reading. The above is the content of "how to use the lsblk command of Linux". After the study of this article, I believe you have a deeper understanding of how to use the lsblk command of Linux. The specific use needs to be verified in practice. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!

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

Development

Wechat

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

12
Report