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.

Resolution
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
3045

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
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 Conferencing and social media domain. The motive of creating cutehits was just to share the knowledge/solutions I get to know during my day to day life so that if possible I can help someone for same problems/solutions. CuteHits.com is a really a very effort for sharing knowledge to rest of the world. For any query/suggestion about same you can contact me on below details:- Email: shekharmca2005 at gmail.com Phone: +91-9560201363

Latest posts by Chandra Shekhar (see all)

You may also like...