Which bash command shows the volume label?
Asked
Active
Viewed 2,462 times
2 Answers
5
/sbin/blkid /dev/sdXY # needs rootpriv for internal drives
ls -l /dev/disk/by-label/ | grep sdXY # workaround for unprivileged users
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.
WinEunuuchs2Unix
- 205