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

learn more… | top users | synonyms

1
vote
2answers
491 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
85 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?
3
votes
3answers
3k 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
236 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
46 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 ...
7
votes
2answers
554 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 ...
0
votes
2answers
229 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
292 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
2answers
462 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 ...
3
votes
5answers
4k 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
105 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 ...
3
votes
1answer
4k 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 ...
20
votes
1answer
1k 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 ...
7
votes
1answer
602 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?
13
votes
2answers
2k 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
2k 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
3answers
1k 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 ...
4
votes
3answers
9k 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
4k 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
372 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
34 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 ...
4
votes
1answer
623 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
1k 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
136 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
215 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 ...
6
votes
1answer
641 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
409 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
945 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
1k 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?
9
votes
4answers
5k 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 ...
2
votes
2answers
387 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 ...
6
votes
2answers
2k 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 ...
12
votes
3answers
897 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. ...
1
vote
1answer
553 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
208 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 ...
9
votes
6answers
9k 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
2answers
920 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 ...
4
votes
2answers
760 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 ...
3
votes
4answers
20k 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 ...
3
votes
2answers
2k 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 ...
12
votes
2answers
1k 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
693 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 ...
11
votes
5answers
4k 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 ...
14
votes
3answers
4k views

How to kill a process with a single command?

I want to kill a process, after finding the id in a single step. I currently use these two commands: pidof <name> kill <#number_which_is_result_of_command> How can I write a single ...
1
vote
1answer
600 views

How to make the system automatically kill some processes?

Sometimes my computer starts to behave sluggishly after running too many programs/processes simultaneously, at points almost looking crashed/frozen. Using Debian Linux, is there a way to ...
3
votes
2answers
782 views

How can I kill the top CPU/IO process quickly?

I find that sometimes my Linux will stop responding, so I need to switch to another terminal with CtrlAltF2, and type a command to kill the top CPU usage process or top IO usage process, so that the ...
1
vote
2answers
2k views

Kill all processes related to an application

I have two processes that are temporarily spawned and I need to kill them. Here are the processes from ps aux david 38329 0.0 5.0 3916476 104624 s002 S 11:33AM 0:17.43 ...
4
votes
3answers
2k views

Exit Google Chrome from terminal

Is there a way to cause google-chrome to quit, from the terminal, besides using killall google-chrome? I would like to be able to close it from a script without killing it.
2
votes
1answer
721 views

how to get out from the command iostat on unix?

I was installing a .iso 8,2 version in a vmware to learn unix., and i am stuck with iostat command, i run iostat 3 and is keep going to show me the results, but whem i put exit or q or q! to exit, he ...
1
vote
1answer
187 views

Creating Cron Task to kill stalled/failed runs in a system

I was given a task to create a cron which finds, kills and clears old puppet runs that were not successfully installed. I am more or less looking for a starting point.