Skip to content

Instantly share code, notes, and snippets.

@esell
Created March 27, 2017 21:06
Show Gist options
  • Save esell/3756d9fba25ca5db698ce9d35a6918a5 to your computer and use it in GitHub Desktop.
Save esell/3756d9fba25ca5db698ce9d35a6918a5 to your computer and use it in GitHub Desktop.
#!/bin/sh
dmesg | awk '
/sd[a-z].*logical blocks/ {
gsub(/\[|\]/, "", $5)
gsub(/[aA-zZ]/, "", $11)
gsub(/\//, "", $11)
print $5, "-", $11
}
'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment