Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Stop an application through terminal [closed]

Tags:

ubuntu

I am using Ubuntu and i would like to stop a running application from terminal, more precisely through a script. One way is to get the pid of the process and issue a kill command with the pid of the process. But how do i get the pid of running applications? Or is there any better way to do this?

like image 585
nikhil Avatar asked Apr 15 '11 18:04

nikhil


People also ask

How do I stop a program execution in terminal?

Then we hit Ctrl+C to terminate the execution.

How do you shut down an application that won't close?

On iOS and Android devices, long-press the Home button and then swipe an app's preview card upward on iOS or to the right on Android to force quit.


2 Answers

you can use

ps -ax | grep application name if your searching for firefox type below command

ps -ax | grep firefox

it shows the processing id of corresponding applications you can stop that application by kill command if process id=1317,

kill -9 1317 
like image 148
Naveenbos Avatar answered Nov 01 '22 12:11

Naveenbos


How to stop an application from opening at start?

You will have to type ps -A and Enter.

After that you will get a list of every app that that is starting by itself.

kill -9  (the number of the app)

Send me a message it that does not help you.

like image 6
Mauro Avatar answered Nov 01 '22 12:11

Mauro