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

learn more… | top users | synonyms

2
votes
3answers
53 views

Bash | port killing loop fails

I am trying to create a bash function which should kill all processes using some ports specified in port_array. The kill-port function works if I call it myself with a port e.g. with kill-port "80";. ...
14
votes
4answers
6k 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
17 views

Is Ctrl+C on make check safe?

I am installing GNU Guile and I have ran ./configure ... as well as make. I am now running make check and it is taking a really really long time. If I use Ctrl+C to abort this make check, will it mess ...
14
votes
3answers
11k 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 ...
4
votes
2answers
56 views

How to kill a bunch of jobs based on ps output?

Here is output from ps: $ ps aux | grep blob ubuntu 4286 0.0 0.1 34748 9592 ? S Jan14 0:00 /usr/bin/python /usr/local/bin/pynt start_blob_reader ubuntu 4287 0.0 0.1 34748 ...
0
votes
2answers
521 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 ...
26
votes
5answers
74k 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. ...
3
votes
2answers
175 views

kill: SIGSTOP: invalid signal specification error in bash script

When I use kill on command line it works. kill -SIGSTOP 1234 But if I use in bash script file I get this error: kill: SIGSTOP: invalid signal specification sh file is #!/bin/sh kill -SIGSTOP ...
8
votes
5answers
3k 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.
3
votes
1answer
39 views

What could be happening between pidof and kill to cause “no such process”?

I've inherited quite a bit of code and am looking at a cron job that restarts a service once an hour, no other scripts touch this process and this code is ran. #The name of the process has been ...
5
votes
4answers
46k 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 ...
1
vote
2answers
60 views

How to keep a process from running?

I can kill a process. But how do I keep that process from being called up again without removing it from Linux? For example, if I run something like netstat to find the port associated with the ...
5
votes
3answers
105 views

How to identify why a process won't die after SIGTERM

I have a process which appears to be hung. When I try and reboot the process, I get a timeout. service logstash_server stop timeout: run: logstash_server: (pid 11797) 839061s, want down, got TERM ...
100
votes
7answers
12k views

How to kill a runaway cat?

Many times I accidentally run the cat command on files that have contents up to few thousand lines. I try to kill the cat command with Ctrl+ C or Ctrl+Z, but both only take effect after the total ...
0
votes
1answer
50 views

killing a job running in the background

I have started running a long job by creating a script that executes several commands on 20 or so datasets sequentially. I began in the xterm window with $ script.scr then typed <ctrl-Z> ...
12
votes
7answers
16k 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 ...
1
vote
2answers
259 views

Kill browser when lock screen

I am running xubuntu on a shared low-ressources computer. I would like to run a script that kills the browser (firefox and chromium) whenever the user locks the screen, so that other users can use the ...
15
votes
8answers
9k views

pgrep and pkill alternatives on mac os x?

Are there alternatives to pgrep and pkill commands on Mac OS X or should I just create aliases for them using other commands available for me?
26
votes
9answers
3k views

How can I kill a process and be sure the PID hasn't been reused

Suppose, for example, you have a shell script similar to: longrunningthing & p=$! echo Killing longrunningthing on PID $p in 24 hours sleep 86400 echo Time up! kill $p Should do the trick, ...
1
vote
1answer
46 views

Linux- Stop a process running as daemon

I've started uwsgi as a daemon, how can I kill that process? Everytime I kill its pid, and then does ps aux | grep "uwsgi", it again comesin the output. I've also tried pkill uwsgi, but no use. How ...
0
votes
1answer
31 views

Exporting a piped command without evaluating output?

I'm trying to set an export that would effectively kill a process based on the PID that pgrep feeds it. Running the command kill $(pgrep myAppName) appears to work (if 'myAppName' were the name of an ...
-1
votes
1answer
56 views

writing a script using killproc

Okay, I have an assignment and I am very very new to Unix. Here is what I am trying to do: I wrote a script to kill a running process. I have to use the command killproc..I just dont know where to put ...
1
vote
1answer
61 views

Ctrl+C process termination without Terminal killing

I started using Sublime Text 3 to compile my FreeFem scripts (interpretator PDEs package solver) under Ubuntu 14.04. To invoke the interpretator I customized the build system as follows "shell_cmd": ...
3
votes
2answers
145 views

How do you stop a bash shell expansion?

I know some methods for stopping process. When I type: echo {1..999999} > filename.txt I can't stop it from running. I can stop other processes with Ctrl+C | Ctrl+D | Ctrl+\ and etc. But none ...
251
votes
9answers
106k views

When should I not kill -9 a process?

I am always very hesitant to run kill -9, but I see other admins do it almost routinely. I figure there is probably a sensible middle ground, so: When and why should kill -9 be used? When and why ...
0
votes
1answer
49 views

A higher level of sudo killing a PID

When I ps aux | grep 'S' I see a few programs that I want to kill. According to man ps the state code for S is interruptible sleep (waiting for an event to complete). I've tried kill [Process ID ...
2
votes
0answers
89 views

Catch the kill signal when a process is in S state [interruptible sleep]

This is the process group : (ps -ejH) xxxx xxxx xxxx ? 00:00:00 sshd yyyy yyyy yyyy ? 00:00:00 sshd 8713 8713 8713 pts/0 00:00:00 bash 1234 1234 1234 ? ...
1
vote
1answer
101 views

shell script to auto kill processes matching certain criteria

when running top it shows a couple of processes got nearly 100% cpu usage of the command 'perl' PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND 21287 simon 15 0 4141 ...
2
votes
2answers
12k 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 ...
32
votes
1answer
4k views

Why is the UNIX system call kill named 'kill'?

I'm curious about the history of the name, it seems to me that the 'kill' system call could have been named 'signal', and the 'signal' system call could have been named 'handle'. I was wondering ...
0
votes
1answer
74 views

sleep command not doing what it is supposed to do? [closed]

Im making a bash script where I have to wait for a few seconds (max 10) then run a few commands. This is because when a program is started, it also starts a few useless subprocesses which I don't ...
4
votes
2answers
200 views

Immortal SSH Session

I've got a little TurnKey Linux Debian Squeeze VM that I use for SFTP. I had a user login and transfer a file the other day and now I can't seem to kill the session. I'm still a little shaky in ...
1
vote
0answers
87 views

Stop all processes by a user: children of supervisord are still running

I'm trying to delete a user but it keeps saying that user is currently used by process ID x I tried everything here and here, nothing works, how do I kill all the process by a certain user in order ...
11
votes
1answer
744 views

Why does running `killall init` as user log me out?

On multiple computers running Ubuntu 14.XX, I ran the command "killall init" as user, and was immediately logged out. I could log back in again without a problem. Why is this? What's going on behind ...
1
vote
1answer
39 views

Killing bash causes it to respawn itself

I'm SSHed into my computer at home and I'm trying to format a drive. lsof /dev/sdb2 shows: COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME bash 1366 mitch cwd DIR 8,18 24576 ...
1
vote
2answers
118 views

Ctrl-z doesn't work in vi launched from Gnome terminal

I'm trying to switch Vi launched from Fedora Gnome terminal to background and go back to bash with Ctrl-Z but it doesn't seem to do anything.
0
votes
1answer
111 views

kill parent and child because endless loop

I have a process run by cron every hour. Such process calls another one (not sourced), ie: ./childProc.sh (Not sure if this detail is important) Because of an endless loop in child process (which ...
2
votes
5answers
707 views

How to kill stubborn process

I've an annoying process that won't die: ps -A | grep "nzbget" gives me: 11394 pts/3 00:00:00 nzbget If I try: pkill nzbget (or 11394) ...I get no response and the process is still alive, ...
1
vote
0answers
84 views

pkill -P $ID working while kill — -$ID not

I was playing around with creating and killing process groups on linux ( ubuntu ) I am trying to kill a process group and am being driven crazy by the fact that pkill -P $ID works while kill -- -$ID ...
1
vote
4answers
743 views

Killing a shell script running in background

I have written a shell script to monitor a directory using the inotifywait utility of inotifyt-tools. I want that script to run continuously in the background, but I also want to be able to stop it ...
2
votes
2answers
123 views

gracefully terminating processes with killall <processname>

I am using several instances (profiles) of Icedove (Thunderbird) and when I need to close all of them, I use: killall icedove According to man killall, if no signal name is specified, SIGTERM is ...
1
vote
2answers
79 views

using sudo create another process

I have wrote a shell script names testShell.I run this shell using command: sudo sh testShell Then I use ps -ef|grep testShell|grep -v grep to check the processes created.I find that system ...
0
votes
3answers
278 views

kill several processes using awk tools

I want to stop several processes using awk.My command is like this: sudo ps -ef|grep wget |grep -v grep|awk '{print $2;sudo kill -STOP $2}' I want to stop all processes which is running wget. $2 of ...
1
vote
0answers
170 views

receive signal before process is being killed by OOM killer / cgroups

In our cluster, we are restricting our processes resources, e.g. memory (memory.limit_in_bytes). I think, in the end, this is also handled via the OOM killer in the Linux kernel (looks like it by ...
1
vote
2answers
39 views

Give group the right to send kill signals

I have a process that a user1 runs. And I need to grant all the group members the right to send some kill signal to it. So far, I always get this output: myProcess(13919): Operation not permitted ...
0
votes
0answers
34 views

Why are some processes “killable” by pkill but not killall?

I had over 20 instances of httpd (apache) processes running, so I decided to shutdown these. Normally I use killall, But when I typed killall httpd it just said: No matching processes belonging to ...
3
votes
1answer
295 views

Ctrl+Alt+Backspace to kill X server can't be disabled

I would like to disable the Ctrl+Alt+Backspace shortcut to kill my X server. I have tried disabling it in the gnome-keyboard-properties "Layout Options..." dialog. When I start the dialog, the option ...
2
votes
1answer
82 views

SIGTERM not working occasionally

We use the regular /etc/init.d/jboss stop to stop the jboss on our machines. But at times, it does not stop the process and we get what is pasted below. When this happens we kill the process with a ...
4
votes
3answers
11k 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)
33
votes
2answers
3k views

What does `kill -0` do?

I recently came across this in a shell script. if ! kill -0 $(cat /path/to/file.pid); then ... do something ... fi What does kill -0 ... do?