10 lines
375 B
Fish
10 lines
375 B
Fish
# vi:set ft=fish ts=4 sw=4 noet ai:
|
|
function mem --description "show process memory consumption"
|
|
ps -eo rss,vsz,pid,euser,args --cols=100 --sort %mem \
|
|
| grep -v grep \
|
|
| grep -i $argv \
|
|
| awk '{
|
|
rss=$1;vsz=$2;pid=$3;uid=$4;$1=$2=$3=$4="";sub(/^[ \t\r\n]+/, "", $0);
|
|
printf("%d: (%s) # %s\n\tRSS: %8.2f M\n\tVSZ: %8.2f M\n", pid, uid, $0, rss/1024, vsz/1024);}'
|
|
end
|
|
|