bash 命令显示分区标签

bash 命令显示分区标签

哪个 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

相关内容