Created
July 13, 2017 12:40
-
-
Save jdforsythe/70f8091e20ef76e5517c8574f43a9409 to your computer and use it in GitHub Desktop.
Highest disk usage offending processes
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/bash | |
## requires iotop to be installed | |
sudo iotop -botqqqk --iter=600 >> iotop.log | |
cat iotop.log \ | |
## remove characters before write speed | |
| cut -c 41- \ | |
## look for any write speed that is non-zero | |
| grep -P "^ *(0\.([1-9]\d|0[1-9])|[1-9]\d\.\d\d) K/s" \ | |
## remove characters before the process name | |
| cut -c 30- \ | |
## this sort makes uniq -c much faster | |
| sort \ | |
## count unique lines | |
| uniq -c \ | |
## sort by number descending | |
| sort -rn |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment