volname
Quick Reference
Command Name:
volname
Category:
file system
Platform:
Linux/Unix
Basic Usage:
Common Use Cases
Syntax
volname [device]
Options
| Option | Description |
|---|---|
device |
The device path to query for its volume name (e.g., /dev/cdrom, /dev/sdb1) |
Note: The volname command has no specific command-line options or flags. It simply takes a device path as its argument.
Examples
How to Use These Examples
The examples below show common ways to use the volname command. Try them in your terminal to see the results. You can copy any example by clicking on the code block.
Basic Examples:
volname /dev/cdrom
volname /dev/sdb1
volname /dev/sr0
Advanced Examples:
LABEL=$(volname /dev/sdb1)
if [ "$(volname /dev/cdrom)" = "UBUNTU_20_04" ]; then