Skip to content

Instantly share code, notes, and snippets.

@MattKetmo
Created February 22, 2017 14:51
Show Gist options
  • Save MattKetmo/3f76f83a4a84a104172e0acb1caf2d45 to your computer and use it in GitHub Desktop.
Save MattKetmo/3f76f83a4a84a104172e0acb1caf2d45 to your computer and use it in GitHub Desktop.
memusage.sh
#!/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