kill - Send a specified signal to a process or process group.
0
votes
2answers
40 views
`ps | grep | kill` aborts my script prematurely [duplicate]
I have a Linux computer that I remotely SSH into using plink on a Windows XP machine. I have the Plink program set to execute commands in a script using automated login:
plink -ssh [domain name] -l ...
3
votes
3answers
34 views
Print process ID (PID) of a Matlab instance
To run my Matlab scripts, I've created a shell script to which I give two parameters - the path to the matlab file ($1) and to the log file ($2):
nohup time matlab -some_parameters -r "run $1;exit" ...
0
votes
1answer
54 views
How to kill the (last - 1) PID with bash
I know how to kill the last process with
kill $!
However I would like to kill the last - 1 process, ie not the last one, but the one before the last one.
I tried
kill $$(($! -1))
but it ...
0
votes
1answer
44 views
Why is brk(0) called?
On a first shell I run the command tail with no argument.
On a second shell I kill the first tail using strace to monitor the system calls.
qdii@nomada ~ $ strace kill 1713
execve("/bin/kill", ...
1
vote
2answers
54 views
How to safely kill processes so that output redirection is not aborted?
I'm writing some automation scripts, in which I need to kill some processes.
Previously I would usually use kill -9 pid to kill processes but once upon a time, I notice that when I used kill -9 to ...
1
vote
2answers
38 views
How can I kill gnome shell widgets?
I have some gnome shell widgets that I need to be closed. I am unable to find which processes are behind them.
Any idea how can I kill them?
2
votes
4answers
95 views
pkill can't kill processes with parent process id 1
I want to kill the following processes using
pkill "run_tcp_sender.sh"
or
pkill -SIGKILL "run_tcp_sender.sh"
root 14320 1 0 2012 ? 00:00:00 bash run_tcp_sender.sh ...
6
votes
2answers
118 views
Decode Flags for Kill Command
I am new to Shell Scripting.
I saw this Command on a Book for Linux shell Scripting
$ kill -HUP 1234 >killout.txt 2>killerr.txt
I know what the command does, but i am not able to understand ...
4
votes
1answer
41 views
Suspend and edit previous single line commands
Say I want to modify the latter of some concatenated command line options, is it possible without killing the first command?
Specifically I have compile and run scripts executed thusly:
> compile ...
4
votes
1answer
52 views
Kill user processess on logout
I have a Ubuntu server that handles remote X sessions from users. However, I don't want to allow users to run any kind of background processes - so here is my question:
How do I prevent users from ...
-1
votes
0answers
17 views
Killing Command promt from VB6 OK button [closed]
I want to kill active command promt (cmd.exe) on clicking OK button(vb6 code).
how can i do it?
anybody knows?
0
votes
2answers
85 views
Unix command to exit from command prompt
How can I exit from command prompt from shell file?
shell file contains :
if(); then
// some unix code here
else
// want to exit from cmd prompt or Kill current cmd prompt
fi
can any knows @ it?
3
votes
1answer
86 views
bash: different output between CTRL-C vs “ordered cleanup”
I really tried to find a better title for this question. I am open for suggestions.
I've written a bash script that traps EXIT and calls a function if that signal is received. It calls the same ...
2
votes
1answer
56 views
Why is `kill -s INT <zsh PID>` behaving differently from `Ctrl-C`?
Starting with:
% donothing () { echo $$; sleep 1000000 }
% donothing
47139
If at this point I hit Ctrl-C at the same terminal that is controlling the shell, then the function donothing does indeed ...
1
vote
4answers
168 views
kill a group of processes with negative PID
kill -TERM -PID
is supposed to kill PID and all its child processes.
but this doesn't work on openSUSE, it always tell me that no such process -PID no matter what PID i use.
So if the negative PID ...
2
votes
1answer
57 views
Chain commands with Control + C interrupt
I am trying to execute a program which loops indefinitely, and so must be forcibly interrupted. After executing the program, I want to delete it. I can do it in several steps:
./MyProg
Control + C
...
2
votes
1answer
201 views
What does kill 0 do actually?
In the man page, it says:
kill [ -s signal | -p ] [ -a ] [ -- ] pid ...
pid... Specify the list of processes that kill should signal. Each pid can be one of five things:
0 All ...
16
votes
1answer
492 views
How does systemd survive a kill -9?
Between the recent "Why does 'kill -9 0' end my console session" and "How to get a kernel panic" questions, I got a bur under my saddle and tried kill -9 1 on a mostly up-to-date Arch linux laptop. I ...
6
votes
1answer
239 views
Why does “kill -9 0” end my console session?
I just wonder why kill -9 0 ends my tty console session?
What exactly is PID 0, it is not listed on a ps aux?
10
votes
2answers
370 views
Why does bash show 'Terminated' after killing a process?
Here is the behaviour I want to understand:
$ ps
PID TTY TIME CMD
392 ttys000 0:00.20 -bash
4268 ttys000 0:00.00 xargs
$ kill 4268
$ ps
PID TTY TIME CMD
392 ttys000 ...
0
votes
2answers
150 views
Sending SIGUSR1 to parent
When I do a kill -SIGUSR1 $PPID I get kill: (1) - Operation not permitted . How can I overcome this?
0
votes
1answer
90 views
Kill nohup command on cluster
Last night I launched a command via nohup on a cluster and then closed the connection. Today I would like to kill this job (I know it's still running because output is being generated in an output ...
1
vote
3answers
231 views
Kill only one Java process
I usually run few Java applications, one for server running locally and other for some IDE like NetBeans. And from time to time, after lots of redeployments, my server get stuck on ...
2
votes
3answers
293 views
Killing a tree of processes in top/htop
htop allows me to nicely see trees of processes within the shell. I can kill processes by pressing F9 (KILL) and then selecting which signal (e.g. 15 SIGTERM) I want to send to a job to kill.
...
5
votes
3answers
299 views
What did I just kill?
Is there any way to find out what I just killed?
$ ps -A -o pid,cmd | grep someApp | grep -v grep
2802 python someApp.py
$ sudo kill 2302
$
EDIT: To clarify, I need to know what PID 2302 was before ...
2
votes
1answer
27 views
Mediastream goes defunct
I am running my donnet framework based application using mono in Linux Ubuntu. My application uses linphone's mediastream command to open the RTP socket and hook the audio device.
I am using the ...
3
votes
1answer
144 views
What is the difference between exiting a process via Ctrl+C vs issuing a kill -9 command?
I know I can kill any process with kill -9 command . But sometimes i see that even if I have terminated a program with CTRL+C , the process doesn't get killed . So I want to know the difference ...
3
votes
1answer
179 views
Cannot kill a java process
I have a java process that cannot be killed. I have tried every method I know, or that I have found on the internet to no avail. I have tried:
killall java
kill -9 <pid>
kill -11 <pid>
...
2
votes
1answer
96 views
Refreshing less on the fly
I'm writing a script in which I pass the output of a function to less, wait for some time, and then kill less. All of this done inside a loop. This makes it look like less is updated on the fly. ...
1
vote
1answer
87 views
Application in terminal still running but not directly accessible [duplicate]
Possible Duplicate:
How to suspend and bring a background process to foreground
I have kind of an odd problem which I haven't encountered before. Here's what I did:
I started an ...
5
votes
1answer
234 views
`kill -s TERM` works, `kill -s ABRT` gets “Operation not permitted”
There is a process that I own whose documentation claims I can send SIGABRT to in order to get some debugging information. However, when I try to send SIGABRT, I get back "Operation not permitted".
I ...
5
votes
4answers
202 views
Accidental `nano SomeFile | uniq` renders the shell unresponsive
In my attempt to get unique entries (read lines) out of a simple text file, I accidentally executed nano SomeTextFile | uniq.
This "instruction" renders the shell (bash) completely (?) ...
2
votes
2answers
201 views
Why can't I kill a timeout called from a Bash script with a keystroke?
[Edit: This looks similar to some other questions asking how to kill all spawned processes – the answers all seem to be to use pkill. So the core of my question may be: Is there a way to propagate ...
1
vote
3answers
178 views
I want to kill all processes that result from the following command
The following command will display all the PID's running for vmstat1:
ps -ef | grep "vmstat 1" | awk '{ print $2 }'
My question is, how do I kill them all, if there's like 20 of them at once?
5
votes
3answers
1k views
How can I kill and wait for background processes to finish in a shell script when I Ctrl+C it?
I'm trying to set up a shell script so that it runs background processes, and when I Ctrlc the shell script, it kills the children, then exits.
The best that I've managed to come up with is this. It ...
1
vote
2answers
139 views
How to stop a infinite running process (ztail) started by a ssh session after that session is closed
I have a peculiar problem. My server supports multiple ssh session simultaneously, so that multiple admins can manage (via command line interface) it simultaneously. We have a command which calls ...
5
votes
2answers
395 views
kill -9 hangs, unable to kill process (murder proof process) [duplicate]
Possible Duplicate:
What if ‘kill -9’ does not work?
I guess its a bit late to ask this, but for future reference;
I was called to look at a server today after a customer was reporting ...
11
votes
3answers
408 views
How Can Terminal Emulators Kill Their Children After Recieving a SIGKILL?
From what I understand, SIGKILL cannot be caught. This would imply that a process does not have time to kill it's children before the OS destroys it. This can be demonstrated with a shell script.
...
0
votes
0answers
109 views
Trap signals by an external shell on bash?
I tried to do this script:
#!/bin/bash
trap "echo trapped!" SIGUSR2
sleep 3s
kill -SIGUSR2 $$;
exit 0
and it works because it kills itself "from the inner".
if i try this
#!/bin/bash
trap "echo ...
1
vote
1answer
210 views
Korn shell timeout/kill script
I am trying to write a simple Korn shell script to execute a loading process. The process occasionally runs into connectivity issues, so I need to kill it if it runs too long.
I have been trying the ...
4
votes
2answers
104 views
How to kill a process giving it a number of seconds before a doing the forced kill?
I do have the PID of the process to be killed but I do want to give it the chance to die peacefully, without doing a -9.
Expected behaviour: check if PID is still running for up to ten seconds and do ...
4
votes
6answers
861 views
Kill many instances of a running process with one command
This is one of the questions that has troubled me often. Suppose I have thousand or more instances of any process(for e.g. say the process vi) running. How do I kill them all in one single shot/one ...
2
votes
0answers
397 views
`[java] <defunct>` with defunct children -> Any way to collect them?
Relating to question : What if 'kill -9' doesn't work?
I have following situation : zombie process with threads, not collected by init :
[root@Arch64]# ps auxH | grep java
gwpl 569 ...
0
votes
0answers
102 views
my code not able to display the catched signal result [closed]
my code here is intended to display the received signal that's it but its not working when i try to send the signal
kill -SIGUSR1 pid
or
kill -10 pid
or any other signals according to my ...
3
votes
2answers
275 views
Why is `sudo pkill -HUP -f “nginx: master process”` returning code 129 and no output
I'm trying to trigger a reload of the Nginx master process by using pkill and sudo.
The server reloads fine, but I was just curious if anyone knows why the command sudo pkill -HUP -f "nginx: master ...
1
vote
3answers
702 views
How do I exit or cancel a bad bash command?
I expect to get some flak for this, but I can't find the answer anywhere. It seems like it should be so obvious. Sometimes, when I type a bad command in a bash terminal, the cursor just jumps down to ...
2
votes
2answers
395 views
Why would Ctrl-C behave differently than kill -2
I have a program which is supposed to handle SIGINT and gracefully shut down. When I run this program from a terminal without backgrounding it I can shut it down just fine using Ctrl-C. Inspecting the ...
10
votes
2answers
477 views
Is there an upper limit to the number of zombie processes you can have?
I used to work with an HP-UX system and the old admin told me there is an upper limit on the number of zombie processes you can have on the system, I believe 1024.
Is this a hard fact ceiling? I ...
3
votes
1answer
301 views
Can't kill process, not in zombie or uninterruptable sleep [closed]
I can't figure out how to kill this process. I ran du, but it took too long so I tried to kill it. It didn't die. I've tried SIGKILL, SIGSTOP, SIGINT, etc, with no effect (can't kill it, can't stop ...
5
votes
3answers
1k views
How to make `xargs` ignore child's exit and keep processing further
I sometimes run long xargs jobs overnight and it is really annoying to discover in the morning that xargs died somewhere in the middle, for example because of a segmentation fault in one single ...

