Saturday, March 22, 2014

GETTING PROCESS INFORMATION


We all knows that in Linux operating system whatever we execute is a process. So many time we don't know how to get proper information about which process. Basically it's depend on our need that why we have to get information of process.Now if we consodering a normal system user, then we can consider that he needs atleast process id to do some basic operations on that process. For example I open a firefox browser and i want to know what it's process id, so there are two way to get process id.
First way is that we can open terminal and type top command that will show all the process list and from that process list we can get process id, and i think 90% of Linux user among us do the same mistake, or many of us can do ps -aux command but i would like to say that both ways are not right to do. The best way to do this is use of pgrep command. I know for many Linux users pgrep is new. Now what pgrep can do for us, pgrep can directly give us the process id of any process that is in execution. For more details you can type on terminal man pgrep.
Following figure shows that how you can use pgrep command to know process id of any process.

Fig : 01

From other side I can say that amny user need more details of process like process id, thread id, group id etc. So we can see that also by opening the status file of that process. Here you need process id to open status file. From previous process id I am opening the status file of firefox, and all information of that process you can see in following figure. The same think you can do with other processess as well. There are lots of commands are available to make our life easier with Linux.
Fig : 02

No comments:

Post a Comment