Skip to content

Instantly share code, notes, and snippets.

@dominicusin
Created December 22, 2023 04:17
Show Gist options
  • Save dominicusin/c108d48c03aef7dc18fcbe7b1c19fb82 to your computer and use it in GitHub Desktop.
Save dominicusin/c108d48c03aef7dc18fcbe7b1c19fb82 to your computer and use it in GitHub Desktop.
onelinecmd
find /dev/disk/by-id/ -type l|xargs -I{} ls -l {}|grep -v -E '[0-9]$' |sort -k11|cut -d' ' -f9,10,11,12
lsblk |awk 'NR==1{print $0" DEVICE-ID(S)"}NR>1{dev=$1;printf $0" ";system("find /dev/disk/by-id -lname \"*"dev"\" -printf \" %p\"");print "";}'|grep -v -E 'part|lvm'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment