First page Back Continue Last page Overview Graphics

Working with processes: ps

me@box:~$ ps waux | grep apache | wc -l 177

me@box:~$ ps waux | head -n 1 ; ps waux | grep apache | head -n 2 USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND www-data 5028 2.9 0.5 312568 41380 ? S 14:23 2:10 /usr/sbin/apache2 -k start www-data 5616 3.1 0.5 314952 42192 ? S 14:34 1:59 /usr/sbin/apache2 -k start

me@box:~$ ps waux | grep apache | awk '{cpu+=$3} {mem+=$4} END {print cpu "%CPU " mem "%MEM"}' 641.9%CPU 78.3%MEM

me@locutus:~$ ps waux | awk '{print $4 " " $5 " " $11}' | sort -r | head -n 5 %MEM VSZ COMMAND 1.8 2323308 /usr/lib/thunderbird-8.0/thunderbird-bin 0.5 1239004 /usr/lib/chromium-browser/chromium-browser 0.2 732892 /usr/lib/libreoffice/program/soffice.bin 0.2 255736 /usr/bin/X