Sunday, June 16, 2013

How to view Linux processes

Today I will discuss about Linux processes.

In linux every process has a uniq process ID (PID).
When Linux boot, some processes run in background.
and /sbin/init this is a process which run when the OS boot before any other process
and then daemons process run. /sbin/init this process ID (PID) is always 1.

If we want to see current running process we can do it with the following command


The above command will show only process from current user.
if you want to see all processes, use following command

ps -A

If you want to see all details of each process, run the followinc command

ps aux

if you want to see process from specific user, like process run by user sadiq

ps -u sadiq

If you want to see real-tim view of running process, you can use top command


use q or Esc for exiting top program. you can use htop for more interactive result.
htop is not installed by default. you need to install it. For installing htop, you need to install EPEL repository first.

For Redhat / CentOS 5
rpm -Uvh
rpm -Uvh

for Redhat / CentOS 6
rpm -Uvh
rpm -Uvh

And then run the following command to install htop

yum install htop

When htop is installed, use htop command to see top process list.

Follow my next post to learn about controlling processes.

No comments:

Post a Comment