blkid
disk managementlinux
The blkid command is one of the most frequently used commands in Linux/Unix-like operating systems. blkid The blkid command is a utility to locate and print block device attributes such as filesystem type, UUID, and volume label. It's commonly used for device identification and mounting filesystems.
Quick Reference
Command Name:
blkid
Category:
disk management
Platform:
linux
Basic Usage:
blkid [options] [arguments]
Common Use Cases
Syntax
blkid [options] [device...]
Options
Option | Description |
---|---|
-c, --cache | Read from or write to the specified cache file (default: /etc/blkid.tab) |
-g, --garbage-collect | Garbage collect the blkid cache |
-h, --help | Display help information and exit |
-i, --info | Display block device information in name=value format |
-k, --list-filesystems | List all known filesystems/RAIDs and exit |
-l, --list-one | List one device that matches the search parameter |
-L, --label | Look up the device that uses this filesystem label |
-n, --match-types | Restrict probing functions to the specified list of filesystem types |
-o, --output | Specify output format (full, value, list, device, udev, export) |
-p, --probe | Low-level probe of block devices (bypass the cache) |
-s, --match-tag | Show only the tags that match the specified names |
-t, --match-token | Search for block devices with the specified NAME=value |
-U, --uuid | Look up the device that uses this UUID |
-v, --version | Display version information and exit |
Examples
How to Use These Examples
The examples below show common ways to use the blkid
command. Try them in your terminal to see the results. You can copy any example by clicking on the code block.
#
# Show information for a specific device
blkid /dev/sda1Basic Examples:
# Display information for all block devices blkid
Advanced Examples:
# List all available tags for a device blkid -o full /dev/sda1