Which bash command shows the volume label?
Asked
Active
Viewed 2,391 times
5
-
3That's not where the answer goes. – Ignacio Vazquez-Abrams May 08 '11 at 07:04
-
please leave the question section for.. questions.. – Sathyajith Bhat May 08 '11 at 12:39
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
- 185
- 10