Last active
October 19, 2016 00:24
-
-
Save geekpete/e59bb5d5aec3a560383eca2876688610 to your computer and use it in GitHub Desktop.
view top memory consuming processes with some loops of the ps command
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 | |
| for x in $(seq 1 10); do echo $x; echo `date` >> /tmp/top-output.txt; ps -eo rss,pmem,pid,cmd | sort -nr >> /tmp/ps-output.txt;sleep 5; done |
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 | |
| # uses "command" column name in place of "cmd" to work on OSX | |
| for x in $(seq 1 10); do echo $x; echo `date` >> /tmp/top-output.txt; ps -eo rss,pmem,pid,command | sort -nr >> /tmp/ps-output.txt;sleep 5; done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment