Skip to content

Instantly share code, notes, and snippets.

@bonifaido
Created November 2, 2012 12:16
Show Gist options
  • Save bonifaido/4000986 to your computer and use it in GitHub Desktop.
Save bonifaido/4000986 to your computer and use it in GitHub Desktop.
Benchmark your HDD or SSD read/write speed
disk-speed() {
tstfile=/tmp/tstfile.$RANDOM
print "Write speed: " $(dd if=/dev/zero bs=1024k of=$tstfile count=1024 2>&1 | awk '/sec/ {print $1 / $5 / 1048576, "MB/sec" }')
purge
print " Read speed: " $(dd if=$tstfile bs=1024k of=/dev/null count=1024 2>&1 | awk '/sec/ {print $1 / $5 / 1048576, "MB/sec" }')
rm $tstfile
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment