3 ms·
Shameless plug: Sqawk can do nearly the same without you defining a schema. $ ps aux | sqawk -output table \ 'select user, round(sum("%mem
by networked 9y ago
Shameless plug: Sqawk can do nearly the same without you defining a schema.
$ ps aux | sqawk -output table \
'select user, round(sum("%mem"), 2) as memtotal
from a
group by user
order by memtotal desc' \
header=1
┌────────┬────┐
│dbohdan │67.1│
├────────┼────┤
│ root │3.5 │
├────────┼────┤
│ avahi │0.0 │
├────────┼────┤
│ daemon │0.0 │
├────────┼────┤
│message+│0.0 │
├────────┼────┤
│ nobody │0.0 │
├────────┼────┤
│ ntp │0.0 │
├────────┼────┤
│ rtkit │0.0 │
├────────┼────┤
│ syslog │0.0 │
├────────┼────┤
│ uuidd │0.0 │
├────────┼────┤
│whoopsie│0.0 │
└────────┴────┘
Link: https://github.com/dbohdan/sqawk https://github.com/dbohdan/sqawk