Created
August 18, 2017 10:03
-
-
Save YourFriendCaspian/746799808bdb64b4a40d38f42ef583a6 to your computer and use it in GitHub Desktop.
Command Line Disk Benchmark
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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