Questions tagged [kill]

Kill is an operation of removing an object or process from memory so that other processes/variables can use them.

1603 questions
977
votes
31 answers

Is there any way to kill a Thread?

Is it possible to terminate a running thread without setting/checking any flags/semaphores/etc.?
Sudden Def
  • 10,031
  • 3
  • 18
  • 8
867
votes
30 answers

How to kill a process on a port on ubuntu

I am trying to kill a process in the command line for a specific port in ubuntu. If I run this command I get the port: sudo lsof -t -i:9001 so...now I want to run: sudo kill 'sudo lsof -t -i:9001' I get this error message: ERROR: garbage process…
Tampa
  • 75,446
  • 119
  • 278
  • 425
864
votes
11 answers

Kill detached screen session

I learned from somewhere a detached screen can be killed by screen -X -S [session # you want to kill] kill where [session # you want to kill] can be gotten from screen -ls But this doesn't work. Anything wrong? What's the correct way?
Tim
  • 1
  • 141
  • 372
  • 590
801
votes
13 answers

What killed my process and why?

My application runs as a background process on Linux. It is currently started at the command line in a Terminal window. Recently a user was executing the application for a while and it died mysteriously. The text: Killed was on the terminal. This…
sbq
  • 8,049
  • 3
  • 17
  • 5
510
votes
18 answers

How can I kill a process by name instead of PID, on Linux?

Sometimes when I try to start Firefox it says "a Firefox process is already running". So I have to do this: jeremy@jeremy-desktop:~$ ps aux | grep firefox jeremy 7451 25.0 27.4 170536 65680 ? Sl 22:39 1:18…
Paige Ruten
  • 172,675
  • 36
  • 177
  • 197
338
votes
11 answers

How to kill all processes matching a name?

Say I want to kill every process containing the word amarok. I can print out the commands I want to execute. But how do I actually make the shell execute them. ie. ps aux | grep -ie amarok | awk '{print "kill -9 " $2}' Output: kill -9 3052 kill -9…
PuercoPop
  • 6,707
  • 4
  • 30
  • 40
307
votes
7 answers

How can I stop a running MySQL query?

I connect to mysql from my Linux shell. Every now and then I run a SELECT query that is too big. It prints and prints and I already know this is not what I meant. I would like to stop the query. Hitting Ctrl+C (a couple of times) kills mysql…
David B
  • 29,258
  • 50
  • 133
  • 186
219
votes
8 answers

Linux: kill background task

How do I kill the last spawned background task in Linux? Example: doSomething doAnotherThing doB & doC doD #kill doB ????
flybywire
  • 261,858
  • 191
  • 397
  • 503
150
votes
5 answers

What does 'killed' mean when processing a huge CSV with Python, which suddenly stops?

I have a Python script that imports a large CSV file and then counts the number of occurrences of each word in the file, then exports the counts to another CSV file. But what is happening is that once that counting part is finished and the exporting…
user1893354
  • 5,778
  • 12
  • 46
  • 83
150
votes
6 answers

What does `kill -0 $pid` in a shell script do?

Basically, what signal does '0' represent, because here I see SIGNAL numbers starting from 1.
gjain
  • 4,468
  • 5
  • 39
  • 47
126
votes
17 answers

Kill process by name?

I'm trying to kill a process (specifically iChat). On the command line, I use these commands: ps -A | grep iChat Then: kill -9 PID However, I'm not exactly sure how to translate these commands over to Python.
Aaron
  • 2,672
  • 10
  • 28
  • 45
110
votes
13 answers

Why number 9 in kill -9 command in unix?

I understand it's off topic, I couldn't find anywhere online and I was thinking maybe programming gurus in the community might know this. I usually use kill -9 pid to kill the job. I always wondered the origin of 9. I looked it up online, and it…
Alby
  • 5,522
  • 7
  • 41
  • 51
101
votes
5 answers

The GNU screen is unresponsive, seems blocked

GNU Screen seems to freeze. Unable to enter user input. I was using GNU screen and when I pressed the screen it became unresponsive. I can execute all the GNU screen commands, but can't enter user input. I don't want to kill this screen as I have…
sirus
  • 1,519
  • 2
  • 12
  • 17
87
votes
6 answers

shell script to kill the process listening on port 3000?

I want to define a bash alias named kill3000 to automate the following task: $ lsof -i:3000 COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME ruby 13402 zero 4u IPv4 2847851 0t0 TCP *:3000 (LISTEN) $ kill -9 13402
Jonathan
  • 10,936
  • 8
  • 64
  • 79
86
votes
8 answers

How to kill a nodejs process in Linux?

tcp 0 0 0.0.0.0:80 0.0.0.0:* LISTEN 9631/node How do I kill this process in linux(ubuntu)?
LeBlaireau
  • 17,133
  • 33
  • 112
  • 192
1
2 3
99 100