Skip to content

Instantly share code, notes, and snippets.

@YourFriendCaspian
Created August 18, 2017 10:03
Show Gist options
  • Save YourFriendCaspian/746799808bdb64b4a40d38f42ef583a6 to your computer and use it in GitHub Desktop.
Save YourFriendCaspian/746799808bdb64b4a40d38f42ef583a6 to your computer and use it in GitHub Desktop.
Command Line Disk Benchmark
#!/bin/sh
# This came from Greg V's dotfiles:
# https://github.com/myfreeweb/dotfiles
# Feel free to steal it, but attribution is nice
#
# Thanks:
# http://www.amsys.co.uk/2013/blog/using-command-line-to-benchmark-disks/
echo "Benchmarking write..."
dd if=/dev/zero bs=2048k of=tstfile count=1024 2>&1 | grep sec | awk '{print $1 / 1024 / 1024 / $5, "MB/sec" }'
[ -e "`which purge`" ] && purge
echo "Benchmarking read..."
dd if=tstfile bs=2048k of=/dev/null count=1024 2>&1 | grep sec | awk '{print $1 / 1024 / 1024 / $5, "MB/sec" }'
rm tstfile
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment