How to find the attached devices UUID through terminal?

Try this, just press Ctrl+Alt+T on your keyboard to open Terminal. When it opens, list devices by entering:

ll /dev/disk/by-uuid

enter image description here


the best way I found for this is:

sudo blkid

for example the output of a specific USB in my Ubuntu is:

/dev/sda1: LABEL="16GB" UUID="25495C984912BBC3" TYPE="ntfs" 

You can look in /dev/disk/by-uuid/. These files are symlinks to the /dev/... device. For example, my dmraid RAID0 disk (which makes up my root partition is /dev/dm-1 so the following gets its UUID:

$ ls -l /dev/disk/by-uuid | grep dm-1
lrwxrwxrwx 1 root root 10 Nov 21 21:07 1b66bb9e-5b02-49f1-8cf9-bc3f649d70a6 -> ../../dm-1

Tags:

Command Line