5

Which bash command shows the volume label?

2

2 Answers 2

5
/sbin/blkid /dev/sdXY                    # needs rootpriv for internal drives
ls -l /dev/disk/by-label/ | grep sdXY    # workaround for unprivileged users
2
0

To display the label for the currently mounted partition at / use:

lsblk -o LABEL,MOUNTPOINT | grep " /$" | cut -d' ' -f1

Added benefit no sudo required.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .