Created
February 22, 2017 14:51
-
-
Save MattKetmo/3f76f83a4a84a104172e0acb1caf2d45 to your computer and use it in GitHub Desktop.
memusage.sh
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 | |
if [ "$1" = "" ] ; then | |
echo -n "Nom du process : " | |
read process | |
else | |
process=$1 | |
fi | |
ps aux | grep $process | grep -v grep | awk 'BEGIN { sum=0 } {sum=sum+$6; } END {printf("Taille RAM utilisée: %s Mo\n",sum / 1024)}' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment