![bash 命令显示分区标签](https://linux22.com/image/1275116/bash%20%E5%91%BD%E4%BB%A4%E6%98%BE%E7%A4%BA%E5%88%86%E5%8C%BA%E6%A0%87%E7%AD%BE.png)
哪个 bash 命令显示卷标?
答案1
/sbin/blkid /dev/sdXY # needs rootpriv for internal drives
ls -l /dev/disk/by-label/ | grep sdXY # workaround for unprivileged users
答案2
要显示当前安装的分区的标签/
:
lsblk -o LABEL,MOUNTPOINT | grep " /$" | cut -d' ' -f1
无需额外福利sudo
。