Show running Processes in Linux

By Ali Hammad Baig on 3:48 AM

Filed Under: , ,

ps command gives a snapshot of the current processes. If you want a repetitive update of this status, use top command.

Task: Use ps command


Type the following ps command to display all running process
# ps aux | less

Where,

* -A: select all processes
* a: select all processes on a terminal, including those of other users
* x: select processes without controlling ttys



Task: see every process on the system



# ps -A
# ps -e



Task: See every process except those running as root


# ps -U root -u root -N


Task: See process run by user vivek


# ps -u user_name



Task: Use top command


The top program provides a dynamic real-time view of a running system. Type the top at command prompt:


# top



To quite press q for help press h.


Task: display a tree of processes


pstree shows running processes as a tree. The tree is rooted at either pid or init if pid is omitted.If a user name is specified, all process trees rooted at processes owned by that user are shown.


$ pstree



Task: Lookup process


Use pgrep command. pgrep looks through the currently running processes and lists the process IDs which matches the selection criteria to screen. For example display firefox process id:


$ pgrep firefox


Following command will list the process called sshd which is owned by root user.


$ pgrep -u root sshd



Say hello to htop


htop is interactive process viewer just like top, but allows to scroll the list vertically and
horizontally to see all processes and their full command lines. Tasks related to processes (killing, renicing) can be done without entering their PIDs. To install htop type command:


# apt-get install htop


or


# yum install htop


Now type htop to run the command:


# htop


Reference:http://www.cyberciti.biz/faq/show-all-running-processes-in-linux/ps command gives a snapshot of the current processes. If you want a repetitive update of this status, use top command.



Reference:http://www.cyberciti.biz/faq/show-all-running-processes-in-linux/

0 comments for this post

Post a Comment

Blog Widget by LinkWithin