How to close any application program using linux command line

sometimes we get that application program like firefox, geany or image editor which is running on our computer is not responding.Then we get various question in our mind like

*. How to close application from command line?
*. Is there any way to close application from command line.
And others.

Linux and Unix both Operating system has a very good command named Kill command.Here is the steps to use kill command to stop or close any application forcely.

For example:How to close mozilla firefox using command line?

Step 1:Use the below command
Command Structure:

ps aux | grep {application-name}

Actual Command:

ps aux | grep firefox

This will show all process which name like

user   2556 27.6 18.1 756884 183840 ?       Sl   15:15   2:25 /usr/lib/firefox-3.6.24/firefox-bin

So you can see the process id in second column

You can check process id of any application with below command

pidof firefox-bin

This will provide the process id

Step 2: Now you have process id of application . Use simply below command to kill application

kill 3045

You are done.

Alternate one line linux  command to do close application

pkill -f firefox-bin

Related posts:

The following two tabs change content below.

Chandra Shekhar

GCP Architect
Chandra Shekhar Pandey is Google certified Cloud engineer, I am Magento2 Trained developer. Having huge experience in designing cloud solution. I have around 12 years of experience with world enterprise IT companies and fortune 500 clients. During my architecture design I am always caring about high availability, fast performance and resilient system. From the programmer background I have huge experience in LAMP stack as well. Throughout my carrier I have worked on Retail, E-Learning, Video... Read More about Chandra Shekhar

Latest posts by Chandra Shekhar (see all)