Check your processes that you are interested in kill.
Suppose you want to kill all the invalid instances of “sshd” that might created mistakenly.
What will you do? Any idea, think little. Well first we need to see how many “sshd” instances are running on our server. So the best command to use is “grep” it first.
We can see on the second item is the process id, and to kill any process we need its process ID or processes IDS.
Here we see there are the sshd instances created by the username rohit, which is really many. Yes we want to kill them off.
Select the processes with specific rohit user:
Command: ps -ef |grep “rohit” or ps -ef |grep rohit
The above command will give you the process related with user rohit or any process with name rohit. You must remember to replace it with your identifier or keyword that you want to look into process list.
But that was not our objective, we want to kill them off.
Have you heard about AWK, well we will not take this in this tutorial but will discuss separately on separate post. Subscribe with us may help you to be in touch and get email of various post we are posting on our site.
We know the command “kill” only takes process ids.
Let get the process ids
Command: ps -ef | grep “rohit” | awk ‘{print $2}’
Command to Select Print Process ID on Shell Console.
Only one more command to go, to kill all these process IDs.
Hey guys, thanks for reading our posts. We are collecting news and information that required our attention and make us to thinks upon it. We make our blogs as much as informatory to support our needs. Hope we will be encouraged and have your comments and thoughts on maximum posts.