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

learn more… | top users | synonyms

6
votes
4answers
16k 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)
3
votes
2answers
266 views

Interrupting very long output in tmux

In a (gnome) terminal, if I cat a file which turns out to be much too long, I can always press Ctrl-c to interrupt. However, in tmux, when the same happens, it takes long for the signal produced by ...
20
votes
4answers
14k 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
0answers
32 views

program “killed” as soon as it run

Ubuntu 12.04 I have success make and output a program name algo. When I type ./algo,the terminal just directly shows 'killed' And I search the var/log/message or syslog kern.log.I don't see any ...
0
votes
1answer
33 views

I cannot kill crond - trying to stop cron service

This is frustrating, I try: service crond status And get this: Redirecting to /bin/systemctl status crond.service crond.service - Command Scheduler Loaded: loaded ...
6
votes
2answers
107 views

Kill a suspended process?

I was slightly confused by: % vim tmp zsh: suspended vim tmp % kill %1 % jobs [1] + suspended vim tmp % kill -SIGINT %1 % jobs [1] + suspended vim tmp % kill -INT %1 % jobs [1] + suspended ...
0
votes
2answers
631 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 ...
0
votes
3answers
51 views

Killing a comet zombie

I have a zombie process that is changing its PID, which is increasing. Is it possible to kill a process with PID greater than N?
1
vote
1answer
47 views

Killing PGIDs but proceses are respawning, how do I make it persistent?

I ran ps aux --forest -j to see parent and child processes. Here is an example: root 3744 3744 3744 0.0 0.2 77084 4160 ? Ss 09:34 0:00 /usr/sbin/cupsd -f lp 3747 3747 ...
1
vote
1answer
50 views

Why kill -9 -1 doesn't work?

From man kill: kill -9 -1       Kill all processes you can kill. But when I do sudo /bin/kill -9 -1 nothing happens. My uname -a for info: Linux michal-Q530 ...
0
votes
0answers
32 views

Why process is killed while a lot of memory is free?

I am running a python script in ipython. This script will take about 8GB RAM. The system has more than 80 GB free RAM but the swap is nearly 0. My script was killed after it runned for a while. I want ...
12
votes
4answers
8k 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
1answer
49 views

How to kill a task that cannot be killed (uninterruptable?)

I have a task running that blocks pm-hibernate (on Linux 4.0.7-2). When I try pm-hibernate there is an error message "Freezing of tasks failed after 20.002 seconds (1 tasks refusing to freeze, ...
3
votes
2answers
50 views

bash + how to hold shell scripts

Is it possible to hold/stop the bash script progress without to kill the process? ( by kill command ) or other command For example this script - install_linux_pkgs.bash , will install Linux pkgs ...
2
votes
2answers
50 views

How do I kill a process after detaching it from bash?

I have multiple scripts that detach a process from bash using nohup and &>/dev/null &. My question is, how do I kill the process after completely detaching it from bash. using killall or ...
269
votes
9answers
110k 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 ...
8
votes
3answers
4k 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. ...
0
votes
1answer
154 views

kill processes in one line with kill, awk, ps, and grep

I have a few processes that spring up and I am able to print a line of the pgid's that I would like to enter into a kill command. here is what I have: sudo ps o pgid,args | grep mininet: | sudo awk ...
9
votes
1answer
945 views

Still alive, still alive after kill -9 / SIGKILL [duplicate]

An apache2 process got stuck on my server and caused problems with other services. (original problem: kerneloops after USB hardware disconnect) root@server:~# ps aux | grep apache2 | grep -v grep ...
9
votes
4answers
66k 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 ...
14
votes
7answers
23k 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
1answer
49 views

Can I resume make after a Ctrl+C?

I am installing gcc version 5.1 on a supercomputer cluster. I configured it and am now running the make command. It has been several hours and is still running as it is a long install, but the work ...
18
votes
4answers
5k views

Linux: Kill process based on arguments

How can I kill a process based on its command line arguments? killall, pgrep, and pkill seem to only work based on the process name. I need this to be able to differentiate between a number of ...
2
votes
6answers
376 views

How to close all proceses without restarting a machine?

I have a lot of processes running and I need to kill them all. How can I do this without restarting a machine?
1
vote
1answer
32 views

Stopping jobs by PID?

Could someone tell me why I am unable to kill the jobs below when specifying their PID? I can stop the jobs when using their % id. Mac:~ gd$ ps PID TTY TIME CMD 4523 ttys000 0:00.02 ...
4
votes
5answers
5k views

Why teamviewer starts again after being killed

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
1answer
150 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. The stupid thing is I used $ while true; do blah blah ...
14
votes
3answers
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 ...
5
votes
3answers
231 views

Why won't this process 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 ...
2
votes
3answers
60 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
9k 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
31 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 ...
4
votes
2answers
83 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 ...
35
votes
5answers
101k 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
568 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 ...
9
votes
5answers
4k 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
59 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 ...
1
vote
2answers
65 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 ...
103
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
56 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> ...
1
vote
2answers
311 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 ...
16
votes
8answers
10k 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?
29
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
191 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
33 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
167 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
94 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
172 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 ...
0
votes
1answer
144 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
173 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 ? ...