Linux常用命令——blkid命令

在线Linux命令查询工具

blkid

查看块设备的文件系统类型、LABEL、UUID等信息

补充说明

在Linux下可以使用blkid命令对查询设备上所采用文件系统类型进行查询。blkid主要用来对系统的块设备(包括交换分区)所使用的文件系统类型、LABEL、UUID等信息进行查询。要使用这个命令必须安装e2fsprogs软件包。

语法

shell 复制代码
blkid -L | -U
blkid [-c ] [-ghlLv] [-o] [-s ][-t ] -[w ] [ ...]
blkid -p [-s ] [-O ] [-S ][-o] ...
blkid -i [-s ] [-o] ...

选项

shell 复制代码
-c <file>   # 指定cache文件(default: /etc/blkid.tab, /dev/null = none)
-d          # don't encode non-printing characters
-h          # 显示帮助信息
-g          # garbage collect the blkid cache
-o <format> # 指定输出格式
-k          # list all known filesystems/RAIDs and exit
-s <tag>    # 显示指定信息,默认显示所有信息
-t <token>  # find device with a specific token (NAME=value pair)
-l          # look up only first device with token specified by -t
-L <label>  # convert LABEL to device name
-U <uuid>   # convert UUID to device name
-v          # 显示版本信息
-w <file>   # write cache to different file (/dev/null = no write)
<dev>       # specify device(s) to probe (default: all devices)
Low-level probing options:
-p          # low-level superblocks probing (bypass cache)
-i          # gather information about I/O limits
-S <size>   # overwrite device size
-O <offset> # probe at the given offset
-u <list>   # filter by "usage" (e.g. -u filesystem,raid)
-n <list>   # filter by filesystem type (e.g. -n vfat,ext3)

实例

1、列出当前系统中所有已挂载文件系统的类型:

shell 复制代码
sudo blkid

2、显示指定设备 UUID:

shell 复制代码
sudo blkid -s UUID /dev/sda5

3、显示所有设备 UUID:

shell 复制代码
sudo blkid -s UUID

4、显示指定设备 LABEL:

shell 复制代码
sudo blkid -s LABEL /dev/sda5

5、显示所有设备 LABEL:

shell 复制代码
sudo blkid -s LABEL

6、显示所有设备文件系统:

shell 复制代码
sudo blkid -s TYPE

7、显示所有设备:

shell 复制代码
sudo blkid -o device

8、以列表方式查看详细信息:

shell 复制代码
sudo blkid -o list

在线Linux命令查询工具

相关推荐
BullSmall1 小时前
规则+大模型混合评测:高效精准双保障
运维·自动化
网硕互联的小客服7 小时前
Linux服务器磁盘应该如何合理分区?
linux·运维·服务器
楚识科技8 小时前
合同比对全流程自动化:OCR识别+差异比对+法律风险字段抽取实战指南
运维·自动化·ocr
代码方舟8 小时前
零信任架构实战:基于天远人企关联构建自动化供应链金融网关
运维·人工智能·架构·自动化
段一凡-华北理工大学8 小时前
大模型应用开发 100 天:Python + LLM 从入门到精通 day26~Prompt 调试与优化——A/B 测试与效果评估
windows·python·大模型·prompt·智能体·提示词工程·高炉智能化
贵沫末9 小时前
Ubuntu——常用软件安装
linux·运维·ubuntu
Doraemomo9 小时前
Linux内核驱动开发——中断与定时器
linux·运维·驱动开发
2301_808414389 小时前
Linux中动静态库的理解
linux·运维·服务器
分布式存储与RustFS10 小时前
模型 checkpoint 放对象存储:分片上传、断点续传与残留清理
运维·云原生·开源·对象存储·分布式存储·s3·性能基准
fox_charon10 小时前
Windows 下 CLI 参数的引号陷阱:为什么 --resume 'uuid' 会失败
windows·shell·cmd·cli·引号