strom/fish-misc
Archived
1
0
Fork 0
This repository has been archived on 2023-08-27. You can view files and clone it, but cannot push or open issues or pull requests.
fish-misc/functions/mem.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