Linux technical support - [email protected]


ps

# SHOW PROCESSES
ps aux | head
USER       PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND
root         1  0.0  0.1 126228  5356 ?        Ss   Jan17   0:13 /usr/lib/systemd/systemd --switched-root --system --deserialize 21
root         2  0.0  0.0      0     0 ?        S    Jan17   0:00 [kthreadd]
root         3  0.0  0.0      0     0 ?        S    Jan17   0:00 [ksoftirqd/0]
root         7  0.0  0.0      0     0 ?        S    Jan17   0:00 [migration/0]
root         8  0.0  0.0      0     0 ?        S    Jan17   0:00 [rcu_bh]
root         9  0.0  0.0      0     0 ?        S    Jan17   0:00 [rcuob/0]
root        10  0.0  0.0      0     0 ?        S    Jan17   0:00 [rcuob/1]
root        11  0.0  0.0      0     0 ?        S    Jan17   0:00 [rcuob/2]
root        12  0.0  0.0      0     0 ?        S    Jan17   0:00 [rcuob/3]
# VSZ - vitrual ram size = physical ram + SWAP
# RSS - physical ram
# STAT - state of a process, S - sleep, X - dead, Z - zombie...

# SHOW PROCESSES AND SORT BY RSS
ps aux --sort -rss

# How much memory uses some process in percents
ps -C rsync -o pmem | grep -v MEM | awk '{s+=$1} END {print s}'

# How much memory uses some process in kilobytes
ps -C rsync -o size | grep -v SIZE | awk '{s+=$1} END {print s}'

Leave a Reply

Your email address will not be published.

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>