How to kill background process?


 
Thread Tools Search this Thread
Operating Systems Linux How to kill background process?
# 1  
Old 04-23-2010
How to kill background process?

Hi

I have one file one.sh. In one.sh file their are 5 perl script 1.pl, 2.pl, 3.pl,4.pl, 5.pl.

I ran the one.sh file in background and now I want to kill the one.sh file after 5 min.

but its not killing the processs.


Please let me know how to kill the background process.
# 2  
Old 04-23-2010
Generally you'd kill a process with kill PID where PID is the process number it was given when created. You may need to save this number for later. Names aren't a reliable way to find a process since there can easily be several unrelated processes with the same name...

Beyond that I'd need to see your code.
# 3  
Old 04-26-2010
have you tried kill %1 ?
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Kill an specific process ID using the KILL and GREP commands

Good afternoon I need to KILL a process in a single command sentence, for example: kill -9 `ps -aef | grep 'CAL255.4ge' | grep -v grep | awk '{print $2}'` That sentence Kills the process ID corresponding to the program CAL255.4ge. However it is possible that the same program... (6 Replies)
Discussion started by: enriquegm82
6 Replies

2. Shell Programming and Scripting

How to put FTP process as a background process/job in perl?

Hi, I am using net::ftp for transferring files now i am trying in the same Linux server as a result ftp is very fast but if the server is other location (remote) then the file transferred will be time consuming. So i want try putting FTP part as a background process. I am unaware how to do... (5 Replies)
Discussion started by: vanitham
5 Replies

3. UNIX for Dummies Questions & Answers

Script to start background process and then kill process

What I need to learn is how to use a script that launches background processes, and then kills those processes as needed. The script successfully launches the script. But how do I check to see if the job exists before I kill it? I know my problem is mostly failure to understand parameter... (4 Replies)
Discussion started by: holocene
4 Replies

4. Solaris

Kill snoops running in background

Hi, I want to run 2 snoop commands in the background and would like to be able to kill them when I want to. What is the best way to do that at the command line? if I do a fg at the terminal, will that bring only the snoop that I got running myself so I stop them with a CTRL_C or will that... (2 Replies)
Discussion started by: Pouchie1
2 Replies

5. Shell Programming and Scripting

kill PID running in background in for loop

Guys, can you help me in killing the process which is running in back ground under for loop I am not able to find the PID using ps -afx|grep <word in command I entered> (1 Reply)
Discussion started by: mohan_xunil
1 Replies

6. Shell Programming and Scripting

How to kill background process

Hi, I am new to scripting and learning. please share your knowledge with me. I have a scenario, that i need to trace whether the background script is still running or not? if it was running i need to kill it. i am using the below scripts , but it is not working i dont know why :confused:.... (4 Replies)
Discussion started by: G.K.K
4 Replies

7. Linux

Kill a process without using kill command

I want to Kill a process without using kill command as i don't have privileges to kill the process. I know the pid and i am using Linux 2.6.9 OS. (6 Replies)
Discussion started by: sudhamacs
6 Replies

8. Shell Programming and Scripting

Kill a process without using kill command

Sorry, posted the question in other forum. (0 Replies)
Discussion started by: sudhamacs
0 Replies

9. Programming

kill(0,-9) don't kill the process

Hi all i have simple c program , when i wish to kill the app im using kill(0,-9) , but it seams this command don't do any thing and the program. just ignore it . what im doing wrong here ? im using HP-UX ia64 Thanks (9 Replies)
Discussion started by: umen
9 Replies

10. UNIX for Advanced & Expert Users

When kill doesnt work, how to kill a process ?

Hi All, I am unable to kill a process using kill command. I am using HP-UX system. I have tried with kill -9 and i have root privilages. How can i terminate this daemon ? ? ? Regards, Vijay Hegde (3 Replies)
Discussion started by: VijayHegde
3 Replies
Login or Register to Ask a Question