Monday, July 16, 2012

Top vs ps command

Top Command

Top command is used for displaying top CPU processes which are currently live.
It periodically updates the selection of processes and displays it.

It is similar to Windows Task Manager in Windows.


Line 1 time, users load averagzombiee.
Line 2 total tasks, how many of them are running, stopped or zombie
Line 3 CPU usuage
Line 4 Memory Analysys

Highlight the running process by pressing z.

Kill a task: Press k - to kill a task and then PID 
Example: 3290 is PID of docky.
                Press k then PID : 3290


Learn more about top: $man top



ps command

ps (process status) command gives a snapshot of the current processes.

Example: $ps -ef    ---->to see all processes
             



Column 1 UID - user id
Column 2 PID - process id
Column 3 PPID - parent process id
Column 4 TTY - gives the name of the terminal connected to the standard input

Learn more about ps: $man ps


Zombie processes are those processes which have finished the execution and have released all the resources but still had an entry in the process table.

Example: $ps aux   ----> snapshot of all the processes will come and processes with STAT "z" are zombie processes







1 comment: