So, guys I am back with the next part of my attempt to teach some basics to you. Those who have seen all the seven parts of this series must continue with this article. Those who haven’t read must check the previous parts of this series must read them before reading the current one. This article is based on Linux process management.
Linux Process Management
In the last part I told you about the networking command of the Linux OS. In this part we are going to talk about the linux process management. Process management in Linux is a very important part of Linux administration. There is many times when the process that should be closed naturally do not closes, then these process management commands came to focus.
In Linux, every process is termed as a program, the system processes are called as demons. For example http process is referred as httpd demon.
The linux process management are very powerful for a process who is behaving unnaturally.
Process Running in the System
To know about all the process running on the computer, the command ps is used with 3 switches i.e. a,u,x. The command is typed as
The switch a,u,x are referred as all processes, user & processes not associated to a terminal respectively. After the command is entered, it will show you four things about every process i.e. user ,PID (process identifier) , %CPU , percentage of memory used.
The command is ps can be used with one more switch i.e. A. This switch provides us some limited information about the processes. This command will show you Process ID & Time when it started. To manage a process ID is very useful in controlling a process.
Top command is same as ps command but the basic difference is about this command is that it only shows you those process that are using more resources than other smaller processes. Another difference is that, this command is dynamic. The process which will be completed will disappear in the display & other processes will take its place.
Kill a process
To kill a process means to remove a process from the main memory. When a process do not terminate naturally then we have to terminate a process by kill command. The command needs the process Id of the process & uses the Id to kill the process.
kill <process ID>
There are some processes who still do not get terminated after the kill command, then using a switch in the command you can kill the process.
Set a priority to a process
You can not exactly set a priority to a process but you can tell kernel to give a little priority to a process. Processes are given the priority with the help of numbers. These numbers are from 0 to 127, with 0 as highest priority & 127 as the lowest.
The priority of a process is decided by the kernel. We can still give a hint to the kernel to prioritize the process by using nice command. With nice command, a process gets a priority between -20 to 19.
We can also set a priority between -20 to 19 by using this simple -n switch.
nice -n -20 airbase-ng -a 00:09:5B:6F:64:1E –essid “Elroy” -c 11 mon0
In this command a process airbase-ng is given a priority of 20. In fact we can renice the process by using the command renice like this.
renice 15 5143
5143 is the process Id of airbase-ng & the priority given to this process is 15.
Push Process in the background
If we don’t want to use a terminal or a process for some time, then we can put it to background. This can be done by using & sign from the keyboard. The command will look like this.
airbase-ng -a 00:09:5B:6F:64:1E –essid “Elroy” -c 11 mon0 &
To bring back the process back to foreground use fg command in the terminal. You can also use the ctrl + z command to put back in background.
Thanks for reading this article, I hope you have understand the Linux process management concepts which I told you here. It complete for now. Follow us on Facebook for more updates like this one. Thank You.