Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- #
- #Description: Muestra los usuarios del sistema y la suma total de la memoria virtual consumida
- #
- #Author:jMa
- #
- nombres=(`ps aux | tr -s " " | cut -d " " -f 1 | sed '1d' | sort -u`)
- suma=0
- echo -e "USER\t\tTOTALVSZ"
- for i in ${nombres[*]}
- do
- ps aux | tr -s " " | cut -d " " -f 1,5 | grep $i | cut -d " " -f 2 > memv
- while read line
- do
- let suma=$suma+$line
- done < ./memv
- echo -e "$i\t\t$suma"
- done
- rm -f memv
Advertisement
Add Comment
Please, Sign In to add comment