Last active
December 7, 2020 08:01
-
-
Save armujahid/7de4e9eeed6837637226ceccbf146849 to your computer and use it in GitHub Desktop.
memsum
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 | |
# Sum the memory usages of all the processes of a program | |
# | |
# forked from https://unix.stackexchange.com/a/537658/102240 | |
ps -eo size,command --sort -size | grep $1 | awk '{ hr=$1/1024 ; sum +=hr; echo $1} END {print sum "MiB"}' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment