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

learn more… | top users | synonyms

1
vote
1answer
59 views

sudo kill: Operation not permitted over SSH

Using heredoc to execute multi-line commands on a remote machine. Trying to get pid of a server to kill that server located in the remote machine #!/bin/bash HOST_IP="10.180.5.23" read -p "For HOST ...
1
vote
1answer
25 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 ...
5
votes
2answers
99 views

Suspend process without killing it

So I've got a persistent program running in the background. Killing it just causes it to restart with a different PID. I'd like to suspend it (put it to sleep without actually killing it). Does kill -...
0
votes
3answers
110 views

process command and the percent sign usage

I am confused about stopping a job by using the percent sign with the kill command. I cannot find any documentation in the man pages for kill that indicate the percent sign can be used. Can someone ...
3
votes
2answers
98 views

How to stop an ssh server on arch linux

When I run systemctl start sshd.socket on my Arch Linux machine, then log into the server from my mac, then run systemctl stop sshd.socket on my Arch Linux machine, nothing happens until I ...
9
votes
3answers
918 views

How to kill multiple processes

to find the PID of the process to kill use : pgrep <process command> I then use the kill command to kill the PID returned by pgrep <process command> kill <PID> Can these ...
0
votes
0answers
15 views

Why uget stops working and exits unexpectedly?

I have been using UGET in order to download what I need. I've had no problems with it until I tried downloading a file with 4.5 GB of volume. 3.6 GB of it has been downloaded and UGET stops working ...
22
votes
10answers
47k 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 ...
12
votes
3answers
3k views

How signals work internally?

In general, to kill processes we generate signals like SIGKILL,SIGTSTP etc. But how is it known who ordered that particular signal, who has sent it to a particular process, and in general how do ...
0
votes
1answer
35 views

Why are processes stuck in system calls (sometimes) unkillable? [duplicate]

I recently had a problem with a c program I wrote. According to ps it was stuck in a system call, even kill -9 didn't change anything about it. Even a restart didn't work, it was stuck forever in ...
0
votes
3answers
1k 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 &...
1
vote
1answer
58 views

How to kill all sessions for a Linux user except first one, and limit users to one login session

I need to know how to kill all processes for a logged in user except the first one in linux redhat 6. for example, AZain user is logged in multiple times from different machines so I need to allow ...
1
vote
1answer
36 views

Can't terminate / suspend a background job

I am a beginner so I wanted to do a test for the Job Control Commands. So, I ran a cat command and then made it a background job using the bgcommand after stopping it with Ctrl +Z. Now I wanted ...
1
vote
2answers
39 views

How to stop “tail -f” within a running script? [duplicate]

How can you stop a tail -f command after seeing a specific string/word? I'm trying to follow an expanding log and stop the tail after finding a specific word. Is there any kill command for that? I'm ...
64
votes
6answers
195k 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. ...
8
votes
5answers
9k 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 ...
1
vote
1answer
34 views

pkill not killing processes past immediate descendants of a process

I want to kill a chain of process e.g. PID PPID 100 XXX 101 100 102 101 When I use pkill -P 100 PID 100 and 101 die as expected, but 102 is given init as it's PPID. How can I force pkill to ...
2
votes
1answer
423 views

Does pkill kill itself (and its parent processes) last?

I'm writing a bash script that kills a bunch of processes selected by certain criteria and then quits. The only problem is that those criteria apply to the script and its parent processes (bash, sshd) ...
1
vote
1answer
77 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
1answer
72 views

Why i couldn't kill the NOHUP process?

So in order to keep my simple blog running permanently, i used the nohup command: nohup python manage.py runserver 0.0.0.0:8000 Everything worked perfectly, my blog keep running even though i ...
316
votes
10answers
123k 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
2answers
90 views

Kill shell script process by name

I have a script running in background like this: nohup /tmp/a.sh & If the script is running for more than 5 mins, I want to kill it. -bash-3.2$ nohup /tmp/a.sh & [1] 2518 -bash-3.2$ nohup: ...
0
votes
0answers
19 views

What is difference between kill [pid] and kill -9 [pid] commands? [duplicate]

I've been using "kill -9 [process_id]" command to terminate the process such as hanged process. However someone told me it is better to use "kill [process_id]". Are there different consequences other ...
1
vote
1answer
42 views

Point and click Ubuntu 16.04 bash script randomly alternates output behavior

I wrote and tested the following point and click Ubuntu 16.04 bash script for the purpose of completely killing a mono-service RecorderManager.exe process by literally killing the process id returned ...
1
vote
0answers
14 views

“Clicking the X” in spectrwm

I'm happily using spectrwm and looking for a way to "click the X", to close a window and kill the process. Both MOD+X and MOD+SHIFT+X just make the window disappear, the process keeps running. How ...
0
votes
2answers
258 views

Creating an automated idle process kill script

I would like to implement a solution to a specific instance of the generic problem wherein idle users tie up resources. I know the user list can be retrieved with w, the associated PID with ps, and ...
11
votes
1answer
565 views

Is there any way to tell if a shell script was killed with signal 9

I have a bash script (called from a java program) that keeps getting killed. I always catch the signal 15 with trap but then some other signal comes along that I suspect is signal 9 but am in ...
15
votes
4answers
137k 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 ...
2
votes
1answer
49 views

Closing many gnuplot -persist windows

I just opened more than a hundred persistent graphing windows using gnuplot -persist with x11 on a RHEL desktop. Is there any easy way to close them all? I don't really want to logout/in or click ...
1
vote
1answer
97 views

A quit command weaker than windowkill?

Typing in xdotool getwindowfocus windowkill currently terminates the active window and bypasses any safeguards like "would you like to save your work?". Is there a weaker command than windowkill I ...
3
votes
2answers
391 views

How do I kill all processes except PID 1?

I want to kill all processes on a system except for PID 1. I am currently using pgrep -l . | awk "{if (\$1 != 1) print \$1}" | xargs -n 1 kill -s INT. awk is used to exclude the process with PID 1 ...
0
votes
2answers
4k views

`ps | grep | kill` aborts my script prematurely [duplicate]

I have a Linux computer that I remotely SSH into using plink on a Windows XP machine. I have a Plink program set to execute commands in a script using automated login: plink -ssh [domain name] -l [...
1
vote
1answer
947 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 ...
3
votes
2answers
138 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 ...
1
vote
1answer
275 views

Why should I not use 'kill -9' / SIGKILL

Posting this question because I was surprised to not find it directly answered; apologies if this is a duplicate - I did look! I have heard that kill -9 or kill -SIGKILL is bad, but I don't ...
7
votes
4answers
2k views

How to stop a bunch of processes on unix fast?

How to stop a bunch of processes on unix fast. I can use ps/top, kill. If the number of processes is very large, I use shell script. Are there other ways, only one or two unix commands can do it ...
1
vote
2answers
73 views

killing a process in one line

Sometimes I need to end a process quickly via terminal but it is tedious to just type ps -e | grep firefox and then kill all the time. I want to create an alias in my .bashrc and just type in ...
3
votes
1answer
57 views

Send process to background using PID

From this question I know you can resume a stopped process by doing kill -CONT $PID is there a kill option to resume a process but in the background (like bg but using a PID?)
3
votes
2answers
71 views

How can I auto-close dropped SSH connections?

When I work on my server remotely, sometimes my SSH connections get dropped due to network issues. When I re-connect to my server, the dropped sessions remain open. I can see them when I run w. I'm ...
2
votes
4answers
3k 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?
4
votes
1answer
157 views

Stop a task based on output

I have a task that runs written in Mono, however sometimes (randomly) the Mono runtime will hang after the task is complete and just print: _wapi_handle_ref: Attempting to ref unused handle 0x2828 ...
1
vote
2answers
28 views

Preventing the accidental killing of wrong process in htop

I frequently use htop to kill certain processes. To find the process I usually execute "Search" via F3. However, the list of processes refreshes frequently, and in many occasions, before I could press ...
0
votes
0answers
68 views

System management locked out by zypper process; refuses to kill

I am attempting to run zypper install nmap on openSUSE Tumbleweed (KDE), but when I attempt to do so I see the following error: System management is locked by the application with pid 12063 (zypper). ...
0
votes
0answers
19 views

What is the difference between the SIGHUP generated by typing “exit” in the SSH shell terminal vs clicking the “X” button in the PuTTY window?

Referring to this question, I am trying to use nohup <command> <arg> & to continue to run a command in the background after I logout from the SSH shell terminal. However, the ...
1
vote
3answers
32 views

What is a non-agressive way of killing a process? [duplicate]

I want to close a program through the command line (say Firefox or Thunderbird). The program is working just fine and in theory I could just go FILE > CLOSE. However, I want to do this through the ...
2
votes
2answers
100 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?...
1
vote
1answer
330 views

Why are --older-than and --younger-than killall options missing in RHEL/CentOS?

I've experienced this issue in cleaning up scripts written by developer who were writing for Ubuntu systems, as well as ServerFault questions like this. Is there any reason the -o, -y (--older-than ...
1
vote
0answers
70 views

Why do interrupted processes show up in nvidia-smi?

When ​I kill processes in terminal using C-c and run nvidia-smi, the process are still shown as "compute processes". These processes are no longer in the top resu​lts. I have to kill -9 to clean them (...
1
vote
1answer
85 views

What are these processes and why can't I kill them?

(On OS X 10.11.3) I'm having a problem starting a java process that needs to listen on port 8040. Getting a BindException. So seems like somebody else is already listening on it. A quick check ...
3
votes
1answer
44 views

Why can't I use `kill $!` with parameter expansion in Bash, when the most recent process is “notify-send”?

According to Bash: Special Parameters: ($!) Expands to the process ID of the job most recently placed into the background, whether executed as an asynchronous command or using the bg builtin I ...