Created
April 24, 2018 05:48
-
-
Save bluebear94/65d5ab24ce9ffb35f14815389a4f4253 to your computer and use it in GitHub Desktop.
Sum memory usage of all processes that match a given name
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 | |
ps -u $USER -o rss=,cmd= | grep -E $1'([[:space:]]|$)' | awk '{ sum += $1 } END { print sum }' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment