How to kill a program?

In terminal...

ps auxc # to determine the PID (process ID) or process name

example...

           PID                                                     name
            |                                                       |
            V                                                       V
USER       PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND
root         1  0.0  0.0 205712  7904 ?        Ss   Jun17   0:05 systemd
root         2  0.0  0.0      0     0 ?        S    Jun17   0:00 kthreadd
root         4  0.0  0.0      0     0 ?        S<   Jun17   0:00 kworker/0:0H
root         6  0.0  0.0      0     0 ?        S    Jun17   0:01 ksoftirqd/0
root         7  0.1  0.0      0     0 ?        S    Jun17   2:57 rcu_sched
root         8  0.0  0.0      0     0 ?        S    Jun17   0:00 rcu_bh
root         9  0.0  0.0      0     0 ?        S    Jun17   0:00 migration/0
r

By process ID...

sudo kill -HUP PID # the nice way
sudo kill -9 PID   # if -HUP doesn't work

or by process name...

sudo killall -HUP process_name # the nice way
sudo killall -9 process_name   # if -HUP doesn't work

I usually do this:

  • find the pid of application is having problems
    ps - A | grep someTextToFind

Example: if your app is doubleCommander

 ps -A | grep doubl 
 2727 ?        00:04:06 doublecmd
 kill -9 2727

If in this way the program also is running.

click on dashboard, search System Monitor

  • find your application
  • click right botton
  • Kill I hope this can help!