mirror of
https://github.com/xHyroM/dotfiles.git
synced 2024-12-26 14:11:05 +01:00
11 lines
352 B
Bash
Executable file
11 lines
352 B
Bash
Executable file
#!/bin/bash
|
|
program=$1
|
|
|
|
while true
|
|
do
|
|
ps -eo size,pid,user,command --sort -size | \
|
|
awk '{ hr=$1/1024 ; printf("%13.2f Mb ",hr) } { for ( x=4 ; x<=NF ; x++ ) { printf("%s ",$x) } print "" }' |\
|
|
cut -d "" -f2 | cut -d "-" -f1 | grep "$program" | \
|
|
awk '{print $0; sum+=$1} END {print "Total: " sum " Mb"}'
|
|
sleep 0.3
|
|
done
|