Skip to content

Instantly share code, notes, and snippets.

@koshatul
Forked from codingtony/serialNumber.sh
Last active December 10, 2015 14:49
Show Gist options
  • Save koshatul/4450015 to your computer and use it in GitHub Desktop.
Save koshatul/4450015 to your computer and use it in GitHub Desktop.
#!/bin/bash
# Print the serial number of your disks with this script
ls /dev/disk/by-id/ata* | sed -e '/-part[0-9]*$/d;s/.*_//' | while read SERIAL;
do
DEVICE=$(readlink -f /dev/disk/by-id/ata*${SERIAL});
echo ${DEVICE}" "${SERIAL};
done | sort;
@codingtony
Copy link

I might change my version with yours.

what's the difference with the original version?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment