Skip to content

Instantly share code, notes, and snippets.

@skyrocknroll
Forked from codingtony/serialNumber.sh
Created January 7, 2013 10:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save skyrocknroll/4473822 to your computer and use it in GitHub Desktop.
Save skyrocknroll/4473822 to your computer and use it in GitHub Desktop.
#!/bin/sh
# Print the serial number of your disks with this script
ls /dev/disk/by-id/ata* | awk -F- '{ if (NF==4) { print $NF} }' | while read SERIAL;
do
DEVICE=$(readlink -f /dev/disk/by-id/*$SERIAL);
echo $DEVICE" "$SERIAL;
done | sort;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment