Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [kill]

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

2
votes
3answers
1k views

What is happening after kill -CONT <PID>?

I have suspend a process through kill -TSTP <pid>. Then tried to continue it with kill -CONT <pid>. But After completion of process, control is not returning to bash. Why this is happening?...
0
votes
2answers
44 views

Why I killed apache user, but it still display?

I am using CentOS 7, Nginx, I don't want use Apache httpd. Then I kill user apache pkill -9 -u apache pkill -KILL -u apache then I check again, I still see user apache. How to kill all process what ...
0
votes
1answer
33 views

Stop multiple processes from command line correctly

I'm executing the following command on mac ./node_modules/.bin/webpack --watch & nodemon dist/server.js I tried killing the processes using Ctrl+C however i still notice that node processes are ...
2
votes
1answer
2k views

How to correctly stop busybox shell process and child process?

The actual server process is spawned by a shell script I am trying to write an init script for djb daemontools within Entware on a router running busybox 1.24 (ash shell). The daemontools way to ...
452
votes
14answers
516k views

What if 'kill -9' does not work?

I have a process I can't kill with kill -9 <pid>. What's the problem in such a case, especially since I am the owner of that process. I thought nothing could evade that kill option.
0
votes
3answers
52 views

How do we write script to kill PID ( If else loop )? [closed]

I have a file which will contain multiple PID's as show below. #cat /scripts/pid_$DATE.txt 12345 23456 34567 45678 I have to write a script which will read the PID's from above file one by one and ...
0
votes
1answer
59 views

kill gnu parallel inside a bash function

I am using gnu parallel in a subshell function, e.g., func()( parallel --will-cite sleep ::: 60 ) upon sending SIGTERM to the function I want parallel to be killed too. But I get $ func & [...
1
vote
2answers
3k 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 (/usr/lib/systemd/system/crond....
4
votes
1answer
2k views

kill or kick all clients from a running vncserver without restarting the server

I encounter quite often the problem, that I want to kick all connected clients from a running vncserver. Even better would be to be able to kick / kill even certain clients. With netstat -tupa | grep ...
1
vote
2answers
938 views

bash kill process by call

I am using bash to start several instances of one python program, like this: python example.py -id $i where $i is the id given to the instance. All the processes are started on the same user, and ...
1
vote
1answer
21 views

Killing two-part process with && by PID

I have a bash script where I am sleeping and then executing a command in a background process. For example sleep 30s && ./script.sh & If I grep ps for "sleep 30s" and kill the process ...
6
votes
5answers
16k 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 ...
8
votes
5answers
13k views

'kill java' doesn't kill java

I am running debian right now and sometimes I need to kill java manually from the terminal, but when I try kill #pid# or pkill java nothing happens. No console output (ok, that's normal) and java is ...
6
votes
2answers
31k views

I don't know how to cancel job

I'm running some simulation by using the Linux cluster but I have some problem in my job. I want to cancel any job(ID : 750, 752, 753 name : gib) but I don't know how to cancel this job. Enclosed ...
8
votes
4answers
67k 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 ...
15
votes
3answers
78k views

How to kill a daemon with its name gracefully?

I usually kill a process with killall. killall markdoc But I am not sure if this command terminates the process gracefully. Does this command achieve graceful termination? If it does not, how can I ...
5
votes
2answers
12k views

How to kill all processes using a given GPU?

I use the CUDA toolkit to perform some computations on my Nvidia GPUs. How to kill all processes that use a given GPU? (killing at once, i.e. without having to manually type the PIDs behind kill -9.) ...
2
votes
1answer
2k views

Kill a running shell script, and kill all process running within it

I have a shell script running in the background, which runs 5 different jobs. When I run the shell script all 5 jobs start running in order. When I kill this shell, whichever process is running, will ...
1
vote
2answers
1k views

Unable to kill process, even with root. How to diagnose?

There are a lot of bash processes running on my Ubuntu Linux (12.04). Even when I close the terminal they are still shown in the System Monitor. I tried killing them as below, but they remain as it ...
-3
votes
4answers
3k views

Why are we using kill -9 always

I would like to know the kill stages. We always use kill -9 and not any other numbers. Can anyone explain the reason.
0
votes
2answers
2k views

Killed process blocks TCP ports

I've had this issue on several machines. Is there some way to free this blocked port? Here is an example: Let me explain. I've killed some JAVA-Process on SUSE Linux Enterprise Server 11 SP4, which ...
4
votes
2answers
911 views

Why does kill not work from script, but does work from terminal?

I have the following contrived script to illustrate my issue: #!/bin/bash set -eux sudo sleep 120 & spid=$! sleep 1 sudo kill $spid wait $! This will print $ ./test.sh + spid=21931 + sleep 1 + ...
7
votes
3answers
12k views

Alternative to `pkill` or `pgrep -f` on cygwin?

Suppose I have started my process like: java -DSOME_STRING -jar foo.jar Then on linux, I can use the following to find or kill this process: pgrep -f SOME_STRING pkill -f SOME_STRING However this ...
2
votes
1answer
48 views

Why is “A stop job is running” a good design choice?

In a typical modern Linux distribution, the user may experience this when trying to shut down the computer: "A stop job is running for Session c2 of user", or equivalent. Now, I understand the idea ...
4
votes
4answers
73 views

Shell Script -kill all process by name but me

I have shell script test.sh that I running. I want that in the beginning of this script ,if there are older test.sh that running ,kill them first. If I killall test.sh the newest process killed too....
0
votes
0answers
73 views

How to stop/kill thread in process

I see all of threads according process with ps -T Is there any way to kill/ stop specific thread(not all the process) by thread id/thread name? I prefer with shell script but if it impassable so in ...
3
votes
1answer
93 views

Why does `kill` not appear to be a Bash builtin? (it should be) [closed]

The Internet is unanimous: kill is a Bash builtin. Bash changelog says the same. However my other builtins apparently think otherwise: $ builtin kill bash: builtin: kill: not a shell builtin $ type ...
6
votes
2answers
1k views

My process was killed but I cannot understand the kernel notice

I have a custom application running on an embedded x86 setup (built using buildroot and uClibc). The application has been running fine but this morning when I returned to work I discovered my process ...
1
vote
2answers
311 views

skill is not working to kill a session in Redhat 7 box

I had Redhat Linux 6.x which was recently upgraded to the Redhat 7 box. Previously I used to use the below command to kill the linux sessions. But now I am getting the the below error if I try to kill ...
15
votes
6answers
117k 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 ...
1
vote
1answer
19 views

How do I run multiple processes with the same process group id?

I am learning how to use the killpg syscall. So for an experiment, I want to start two new processes with the same pgid and then attempt to kill them using killpg. I read about setsid so I tried ...
0
votes
1answer
28 views

How to kill all instances of a program running apart from the newest one

I have a problem whereby my script keeps spawning new ssh processes. This shouldn't happen I know, but I would like to clean the old ones up from time to time. If I do : ps -ef | grep "ssh" | awk ...
3
votes
2answers
2k views

Difference between stop, kill and terminate in Xfce task manager 1.0.1

I'm on Xfce desktop environment, using "Task manager 1.0.1". For more precision you can found it here, a link I got in the "About". When secondary clicking a process, I can stop it, kill it or ...
182
votes
8answers
495k views

How to terminate a background process?

I have started a wget on remote machine in background using &. Suddenly it stops downloading. I want to terminate its process, then re-run the command. How can I terminate it? I haven't closed ...
0
votes
0answers
55 views

Why can I not kill a process in the same line I start it using fuser?

I have been trying to kill a process by looking at the listening port and nothing seems to be working. The code is as follows: (code to open port 8545) && fuser -k 8545/tcp I also tried with ...
0
votes
1answer
54 views

Kill -9 problem in bash file

I wrote a 2 line bash script file in Centos 6.8 #! /bin/sh pid= ps -ef | grep -i 'adminserver' | grep -v grep | awk '{print $2}' kill -9 $pid when I run the script i get the following output: kill: ...
-1
votes
4answers
1k views

Ending Process Infinite Loop Input Redirection

Edit: I realized that the program I was trying to run had an infinite loop after scanning all my input. Then just prints out infinitely so it'll never read the EOF. It'll read the last input then go ...
0
votes
0answers
171 views

kill command SIGKILL vs SIGTERM [duplicate]

there was a nice write up somewhere on here about... not using kill-9 all the time which is SIGKILL and explained the reasons for doing so, and then went on to explain an order in which one should ...
0
votes
0answers
24 views

Unix Commands not working from Crontab [duplicate]

I have this command in a bash script called run.sh kill $(lsof -t -i:34445) On a terminal when i run this script using bash run.sh it works. However, i am using crontab to schedule this command. ...
14
votes
4answers
16k views

killall gives me `no process found ` but ps

Could somebody explain to me the difference between kill and killall? Why doesn't killall see what ps shows? # ps aux |grep db2 root 1123 0.0 0.8 841300 33956 pts/1 Sl 11:48 0:00 ...
0
votes
1answer
333 views

Kill remote process via ssh

I have a process that I want to kill remotely. I tried ssh remotehost "kill -9 $(ps -aux | grep foo | grep bar | awk '{print $2}')" but this returns the error kill: usage: kill [-s sigspec | -n ...
7
votes
3answers
53k views

Kill any service running at a specific port

I am trying to write a script that kills service running at a specific port. This is my script: a=$(ps ax | grep 4990 | grep java | awk '{print $1}') kill -9 $a It's a java program. This script ...
-1
votes
2answers
806 views

alias for killing all processes of a grep hit [duplicate]

I am trying to make a superkill alias that kills all process that hit a grep match. I'd like to do: superkill ruby And have it kill all processes that match 'ruby' In my .bashrc, I've added this ...
3
votes
4answers
2k views

How do I kill a process that keeps respawning, without killing its monitor process?

Is there a way to put a process on some sort of "black list" in Linux?
2
votes
4answers
5k 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?
0
votes
0answers
33 views

Can I safely reduce CPU usage with kill -SIGSTOP?

I have 7 differents workspaces and each of them have a different purpose. But everything runs in the background... For exemple the workspace 5 with my browser is using CPU even when I'm on workspace ...
3
votes
2answers
4k views

lsf bkill all PEND jobs without killing RUN jobs

I'v lots bjobs running on lsf, jobs have two status, RUN and PEND. And I want to kill all bjobs with PEND status, how to do that use script? A hard-coded way I think is saving them in a file then ...
0
votes
0answers
47 views

Background process gets killed in ubuntu 16.04 server

I have a spring boot application and i'm running it as ROOT through this command: mvn spring-boot:run -Drun.jvmArguments="-Xms512m -Xmx1024m" > lms_logs.log 2>&1 & After a few hours ...
2
votes
1answer
86 views

Why doesn't ctrl+u send SIGKILL? stty says it should

I can interrupt a program by pressing ctrl+c in the shell. Often this kills the program but some programs trap the signal and keep running. I want to be able to kill such programs more aggressively ...
7
votes
3answers
6k views

How can I CTRL^C out of a password prompt?

Say I started a su command, and I want to cancel it. Control+C doesn't work for su like it does for sudo... I have to finish the prompt (either by getting the password wrong enough times or by ...