The blkid
command is used to locate and print block device attributes, such as the filesystem type and UUID (Universally Unique Identifier). This command is particularly useful for identifying and managing storage devices on a Linux system.
The basic syntax of the blkid
command is as follows:
blkid [options] [arguments]
-o
: Specify the output format (e.g., value
, full
, list
).-s
: Specify which attributes to display (e.g., UUID
, TYPE
).-p
: Print the output in a parsable format.-c
: Use a specified cache file instead of the default.blkid
blkid -o value -s UUID
blkid /dev/sda1 -o value -s TYPE
blkid -c /path/to/cachefile
blkid -o full
blkid
without any options to quickly get an overview of all block devices and their attributes.-o value
option to make parsing the output easier.