Linux command
lsblk 命令
文件
复制后可按需替换文件名、目录或参数。
常用示例
Example
lsblk
Example
lsblk -a
Example
lsblk -b
Example
lsblk -f
Example
lsblk -t
Example
lsblk -i
Example
lsblk -o NAME,SIZE,FSTYPE,MOUNTPOINT,MODEL
Example
lsblk -J
Example
lsblk /dev/sda
说明
lsblk lists information about all available or specified block devices. It reads the sysfs filesystem and udev database to gather information and displays it in a tree-like format showing the relationship between devices and partitions.
参数
- -a, --all
- Also list empty devices
- -b, --bytes
- Print SIZE column in bytes
- -f, --fs
- Output info about filesystems (FSTYPE, LABEL, UUID, MOUNTPOINT)
- -t, --topology
- Output block device topology information
- -i, --ascii
- Use ASCII characters for tree formatting
- -l, --list
- Produce output in list format
- -o, --output columns
- Specify which columns to output
- -e, --exclude list
- Exclude devices by major device numbers
- -n, --noheadings
- Don't print column headings
- -p, --paths
- Print full device paths
- -d, --nodeps
- Don't print holder devices or slaves (show only top-level devices)
- -J, --json
- Output in JSON format
- -S, --scsi
- Output SCSI device information
- -r, --raw
- Use raw output format
FAQ
What is the lsblk command used for?
lsblk lists information about all available or specified block devices. It reads the sysfs filesystem and udev database to gather information and displays it in a tree-like format showing the relationship between devices and partitions.
How do I run a basic lsblk example?
Run `lsblk` in a terminal, then adjust file names, paths, flags, or remote targets for your system.
What does -a, --all do in lsblk?
Also list empty devices