kill - Send a specified signal to a process or process group.

learn more… | top users | synonyms

8
votes
4answers
214 views

Terminate every background process

I have a few Stopped background processes. kill $(jobs -p) and kill `jobs -p` have no effect kill %1, kill %2, etc. successfully terminate individual processes How can I kill every background ...
4
votes
5answers
328 views

Kill all descendant processes [duplicate]

I'm writing an application. It has the ability to spawn various external processes. When the application closes, I want any processes it has spawned to be killed. Sounds easy enough, right? Look up ...
2
votes
2answers
33 views

Output of one command is piped to another one; how to close both?

I call Qt Assistant like suggested on stackoverflow: nc -lkU ~/.assistantfifo | assistant -enableRemoteControl & Qt Assistant window is opened, and if I call jobs, it returns: [1] + running ...
1
vote
0answers
65 views

Kill Command in linux using bash script [migrated]

I have a bash script abcd.sh,in which I want to kill this command(/usr/local/bin/wrun 'uptime;ps -elf|grep httpd|wc -l;free -m;mpstat') after 5 sec but in this script it kill sleep command after 5 ...
2
votes
2answers
49 views

Bash script to signal a concurrently running instance (same script) about a condition and increment counter

Background Here's what I want to achieve. I have a (potentially) long-running process. Now I have locking in place just fine and all is generally in order. However, since this is a scheduled job, ...
0
votes
1answer
39 views

Can a script be running even after it's been killed?

I know it sounds so stupid and I know it IS stupid but I ran a unix script to send me and my friend emails every few seconds to test mailx. Stupid thing is I used $ while true; do blah blah blah... ...
0
votes
2answers
56 views

Why does kill not have a parameter for file and not for port number?

If I want to stop a program given its tcp port number or its file or named executable, can I run something like kill -tcpPortNumber $1 where the parameter $1 is a tcp port number or kill -filename $1 ...
3
votes
1answer
52 views

Better way to kill all processes with a handle to some file

This kills every process with a handle to file /foo/bar (in bash): lsof /foo/bar 2>&1 | grep "/foo/bar" | sed "s/ */\\t/g" | cut -f 2 | while read PID; do kill $PID; done This does not ...
2
votes
1answer
48 views

Is uninterruptible sleep the only case?

French wikipedia say: Un processus en sommeil ininterruptible ne peut s'arrêter (ni libérer ses ressources) même lorsque SIGKILL apparaît. Il s'agit d'un des rares cas dans lequel un système ...
67
votes
2answers
5k views

How does Linux “kill” a process?

It often baffles me that although I have been working professionally with computers for several decades, and Linux for a decade, I actually treat most of the OS' functionality as a black box, not ...
5
votes
2answers
129 views

Processes do not respond to my signals

I have a strange behavior on my system. When I invoke a command in the shell (bash version 4.2.45(1)-release), say top or cat, the running program (the process) does not respond to Ctrl+C. I even ...
3
votes
1answer
46 views

How (if possible) can I terminate a specific blocker hanging a program?

I have a number of files open in my editor (geany). I managed to hang it doing a sort on a large list that I should have saved and just sent through a pipe to sort via command-line (I mapped one of ...
32
votes
6answers
4k views

Does pressing ctrl-c several times make the running program close more quickly?

I often start to read a huge file and then want to quit after a while, but there is a lag from pressing Ctrl+C to the program stops. Is there a chance of shortening the lag by pressing the Ctrl+C key ...
3
votes
1answer
119 views

How does the piping in this command ultimately achieve to kill the process?

I have seen the following line in a bash script for killing a process(in this case started with the command loadgen): ps xww | grep -i "loadgen" | grep "PATTERNMATCH_FACT.xml" | cut -c1-5 | xargs -i ...
0
votes
2answers
70 views

What does this logrotate nginx config do?

In my /etc/logrotate.d/nginx I saw, /var/log/nginx/*.log { daily missingok rotate 52 compress delaycompress notifempty create 640 nginx adm ...
8
votes
2answers
231 views

How can I create a hard to kill process

I want to create a program that will be difficult to stop (even for the administrator) once it is started (with root privileges). Once started the process should continue to start itself at startup ...
12
votes
3answers
1k views

How to stop a background process?

I have started a wget on remote machine in background using &. Suddenly it stops downloading. I want to stop its process, then start it again. How can I stop it? I haven't close its shell window. ...
0
votes
3answers
427 views

Cannot kill teamviewer process

My main desktop has Mint 14 and I approached it via SSH from another computer, because I didn't have a screen on the Mint one. Then I tried to start teamviewer just I order to launch its desktop ...
1
vote
4answers
57 views

how to close the jobs one by one? is there any options?

There is list of jobs running. pdf is opened image is opened text file opened It's all in fg/bg . Is there any option to close the particular job forcefully? Also, I want to know if the jobs can ...
5
votes
2answers
541 views

Kill process spawned by ssh when ssh dies

This is a question that has been addressed several times, not only here, but also in other sites of the stack exchange network (e.g. ...
5
votes
3answers
227 views

Using `kill -s 0 $pid` vs `[[ -e /proc/$pid ]]` to detect if PID is running

One of the idioms often used to check if process is running is to use kill -s 0 $pid. My question is, does it have any upsides over using [[ -e /proc/$pid ]] construct? The script I'm writing is ...
1
vote
2answers
63 views

"trap 'killall $$ ; rm -f $folder2;exit ' 18 20 24

What is wrong with this command? $ trap 'killall $$ ; rm -f $folder2;exit ' 18 20 24 That command is in a for loop, and while that for is executing, if I press CTRL-Z I want it to stop the process ...
1
vote
2answers
151 views

xargs inside a for loop

So we got most of it figured out but here's what happens. for i in $(arp |sort |awk '{print $1}'|grep IPADDRESS) do ssh USERNAME@$i "ps -ef |grep X11|grep -v grep |awk '{print $2}'|xargs kill" done ...
7
votes
3answers
1k views

Default exit code when process is terminated?

When a process is killed with a handle-able signal like SIGINT or SIGTERM but it does not handle the signal, what will be the exit code of the process? What about for unhandle-able signals like ...
0
votes
2answers
116 views

Kill a nohup mpi process

I have started a program in parallel using the command: nohup mpirun -7 mylongprogram.py & I now want to terminate the program. When I want to kill the process by the command: kill -9 ...
2
votes
0answers
34 views

Reason for the inability of root to send a fatal signal to PID 1/init [duplicate]

Why can't root send a fatal signal to PID 1/init process (sudo kill -9 1)? As stated here.
1
vote
2answers
183 views

How do I kill all screens?

I accidentally created over 1000 screens. How do I kill them all with one command? (Or a few)
0
votes
3answers
1k views

process id and killing process - ps commmand

Please see the output of below ps command: abc@smaug:~/Desktop$ ps ax | grep firefox 2213 ? Sl 2:01 /usr/lib/firefox/firefox 2644 pts/0 S+ 0:00 grep --color=auto firefox Please ...
1
vote
1answer
119 views

Script ends abruptly with a Terminated message

This is my bash script. All it does is to check whether a service has started and whether some processes are running as expected. It ends abruptly with a Terminated message. I tried debugging it ...
1
vote
1answer
186 views

How to create alias to kill processes running on a TCP/IP port? [duplicate]

What I have: alias killport='sudo kill -9 `sudo fuser -n tcp $1 2> /dev/null`' Problem: Running e.g. killport 8000 doesn't appear to work, though. However, simply running... sudo kill -9 `sudo ...
0
votes
2answers
155 views

Pass flags to xargs

I want to kill a bunch of processes using this command: sudo ps ax | grep node | awk '{print $1}' | xargs kill But it gives me operation not permitted even with sudo. Then I tried with kill -9 ...
0
votes
0answers
67 views

cabal dies on NixOS in KVM

I set up a NixOS system on KVM and installed the haskelPlatform package. Everything works fine, ghci works fine, but cabal dies without any helpful error message: [michas@nix:~]$ type -a cabal cabal ...
11
votes
2answers
1k views

Does `kill -p` really work?

In the man page of kill it is written as following SYNOPSIS kill [ -s signal | -p ] [ -a ] [ -- ] pid ... kill -l [ signal ] -p Specify that kill should only print the process id ...
4
votes
3answers
642 views

What's the difference between pkill and killall?

I know that pkill has more filtering rules than killall. My question is, what is the difference between: pkill [signal] name and killall [signal] name I've read that killall is more effective ...
1
vote
2answers
407 views

How can I automatically kill the process with the highest CPU load?

Sometimes programs will lock up in the background and cause high CPU usage. Is there any way I can programmatically ascertain which process is causing the highest CPU load at the moment and kill it?
0
votes
2answers
2k views

How to kill a process that says “Operation not permitted” when attempted?

I have a process I would like to kill: computer@ubuntu:~$ ps aux | grep socat root 2092 0.0 0.0 5564 1528 pts/1 T 14:37 0:00 sudo socat TCP:xxx.17.29.152:54321 ...
2
votes
3answers
279 views

Rotating logs generated from tcpdump with logrotate

On one production linux box, I am capturing SIP packets using the following configuration: logrotate.conf: # Opensips SIP traces /var/log/sip.log { rotate 31 daily missingok ...
1
vote
1answer
69 views

How to list killable tasks?

As manpage of ps states A process with STATUS with the value "D" means "uninterruptible sleep (usually IO)" Also, I've read: You should use TASK_INTERRUPTIBLE here, otherwise your kernel thread ...
2
votes
5answers
502 views

Get return value of process by PID

If I have the PID of a process that was killed, how might I get the return status of the process? I am particularly interested to know if the return status was 143 (kill) or 137 (kill -9) as I don't ...
2
votes
1answer
117 views

kill all process of executables in a folder

I need to kill all the child process. The main process in lmbench pkill -9 lmbench is not killing it, but kill -9 <pid> kills the parent process, but even after killing the parent ...
1
vote
2answers
156 views

How to kill a script which starts new processes?

The following is a Python application which spans a few threads, then spawns a new process of itself and exits: $ cat restart.py import os import random import signal import sys import threading ...
4
votes
1answer
89 views

Stop a task based on output

I have a task that runs written in Mono, however sometimes (randomly) the Mono runtime will hang after the task is complete and just print: _wapi_handle_ref: Attempting to ref unused handle 0x2828 ...
3
votes
3answers
296 views

timeout without killing process in bash

I have a main script that I'm running, and from it I have a second "slow process" I want to kick off, and "do something" in the main script if it doesn't complete in the time limit -- depending on if ...
0
votes
1answer
73 views

pkill process containing special characters

trying to run pkill on file with "+" in the name pkill -SIGTERM -f "auth+live+ec575698789349860987088t897906769878968970" if i take out this part "auth+live+" I am successful I've tried putting it ...
4
votes
1answer
51 views

how to list all instances of an application?

How do I list all instances of an application. ie I am running 12 instances of application called "tcpA" I would like to list all of them. Below is top, I don't know if there is a way to look at a ...
2
votes
4answers
818 views

How to kill a process which can't be killed without rebooting?

There are 5 processes which can't be killed by kill -9 $PID and executing cat /proc/$PID/cmdline will hang the current session. Maybe they're zombie processes. Executing ps -ef or htop will also hang ...
5
votes
2answers
385 views

My process was killed but I cannot understand the kernel notice

I have a custom application running on an embedded x86 setup (built using buildroot and uClibc). The application has been running fine but this morning when I returned to work I discovered my process ...
7
votes
1answer
196 views

How signals work internally?

In general, to kill processes we generate signals like SIGKILL,SIGTSTP etc. But how is it known who ordered that particular signal, who has sent it to a particular process, and in general how do ...
4
votes
3answers
1k views

Terminating a bash shell script running in the background

I often use bash shell scripts to run simple commands for many different files. For example, suppose that I have the following bash shell script, called script.sh, that runs the program/command foo ...
2
votes
2answers
380 views

Closing all Nautilus windows from terminal

How can I close all opened Nautilus (explorer) windows from the terminal?