azq2 zhumarin Рабочий стол cat bin proc bin bash case in -g ps aux gre

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
azq2@zhumarin:~/Рабочий стол$ cat ~/.bin/proc*
#!/bin/bash
case "$2" in
"-g")
ps aux | grep $1 | grep -v $$ | grep -v grep | awk '{i += $6; print $0} END { print (i / 1024 / 1024) " Gb"}'
;;
"-k")
ps aux | grep $1 | grep -v $$ | grep -v grep | awk '{i += $6l print $0} END { print i " Kb" }'
;;
"-m")
ps aux | grep $1 | grep -v $$ | grep -v grep | awk '{i += $6; print $0} END { print (i / 1024) " Mb" }'
;;
*)
ps aux | grep $1 | grep -v $$ | grep -v grep | awk '{i += $6; print $0} END { print (i * 1024) " B" }'
;;
esac