Best way to effectively kill a process?
command line - How to terminate a background process? - Unix & Linux Stack Exchange
bash - How can I kill a process by name instead of PID, on Linux? - Stack Overflow
How to turn on kill switch in nordvpn from Linux mint terminal?
off the top of my head i think its nordvpn set killswitch on/off (choose desired on or off at end)
More on reddit.comVideos
There are different options to kill a proces like hangup, terminate or interrupt (to name a few) but which one is the most effective way of killing a process? Like is there a command with which you can eliminate nasty hard-frozen processes? Sorry if this question sounds dumb, I am just unsure on all the different kill-options and wanted to know the real difference between for example hangup and interrupt - thanks in advance! :)
To kill all the processes that you have the permission to kill, simply run the command
kill -15 -1 or kill -9 -1 depending on the desired behavior (use man kill for details)
To kill a specific process, say, firefox, simply run
pkill firefox or killall firefox depending on the behavior you want: What's the difference between 'killall' and 'pkill'?
If you want to see what processes are running use the command
ps -ef
If you want to look up all processes by user bob, this might help
pgrep -l -u bob
or
ps -ef | grep bob
Use:
kill <pid>
or:
killall <process-name>
There are many ways to go about this.
Method #1 - ps
You can use the ps command to find the process ID for this process and then use the PID to kill the process.
Example
$ ps -eaf | grep [w]get
saml 1713 1709 0 Dec10 pts/0 00:00:00 wget ...
$ kill 1713
Method #2 - pgrep
You can also find the process ID using pgrep.
Example
$ pgrep wget
1234
$ kill 1234
Method #3 - pkill
If you're sure it's the only wget you've run you can use the command pkill to kill the job by name.
Example
$ pkill wget
Method #4 - jobs
If you're in the same shell from where you ran the job that's now backgrounded. You can check if it's running still using the jobs command, and also kill it by its job number.
Example
My fake job, sleep.
$ sleep 100 &
[1] 4542
Find it's job number. NOTE: the number 4542 is the process ID.
$ jobs
[1]+ Running sleep 100 &
$ kill %1
[1]+ Terminated sleep 100
Method #5 - fg
You can bring a backgrounded job back to the foreground using the fg command.
Example
Fake job, sleep.
$ sleep 100 &
[1] 4650
Get the job's number.
$ jobs
[1]+ Running sleep 100 &
Bring job #1 back to the foreground, and then use Ctrl+C.
$ fg 1
sleep 100
^C
$
In bash you can use fg to get the job to the foreground and then use Ctrl+C
Or list the process in the background with jobs and then do
kill %1
(with 1 replaced by the number jobs gave you)
pkill firefox
More information: http://linux.about.com/library/cmd/blcmdl1_pkill.htm
Also possible to use:
pkill -f "Process name"
For me, it worked up perfectly. It was what I have been looking for. pkill doesn't work with name without the flag.
When -f is set, the full command line is used for pattern matching.