Unix Script -- Suggestions to list and kill PID's sequentially
Hi,
I'm trying to write a script where i'm trying to grep the PID and the associated file and list them. Then execute the KILL command sequentially on the listed PID's for ".tra" files
Expecting Output like:
--- Murali.
Is there any build in command in unix to kill all the child process for a given process ID ? If any one has script or command, please let me know.
Thanks
Sanjay (4 Replies)
Hi there, i wonder if anyone can help
is there any way that i can write a script that will kill all current ftp processes, for example if ps -ef | grep ftp produces 3 active proceses, then I would like to somehow extract the PID for each one and pass that to kill -9
has anybody done this... (2 Replies)
Hi All,
In my project i have two process runs in the back end.
Once i start my project, and execute the command ps, i get below output:
PID TTY TIME CMD
9086 pts/1 0:00 ksh
9241 pts/1 0:02 java
9240 pts/1 0:00 shell_script_bg
java with 9241 PID is the main... (4 Replies)
Hellow Experts
i have one problem.
i run one script in backgroun.
and i want to kill that script with only script name.....
so what's the solution..
for your info
my script name is "testscript" n it contains "sleep 100"
thanks.... (16 Replies)
#!/bin/sh
who
echo "\r"
echo Enter the terminal ID of the user in use:
echo "\r"
read TERM_ID
echo "\r"
ps -t $TERM_ID | grep sh
echo "\r"
echo Enter the process number to end:
echo "\r"
read PID
echo "\r"
kill -9 $PID
What this code does is ultimately grab the PID of a users sh... (6 Replies)
Hi,
I'm a newbie when it comes to using UNIX, and I'm hoping someone here can help me out. I have a set of processes that I want to run sequentially:
process1.py
process2.py
process3.py
I want to know I can run these sequentially using their process IDs (PIDs). Ideally, I want to... (2 Replies)
I would want to run a code for 1 min and if it doesnt succeed in 1 min..I would want to exit it..I am using the following code...But the script is not going into my code part.It is waiting for 60 secs and then getting killed.
The code which is in the while loop actually takes less than 60 secs...... (6 Replies)
Hi,
I wrote a script to kill a process id.
I am able to kill the PID only if I enter the root password in the middle of the execution because I did not run as root i.e after i run the script from the terminal, instead of killing directly, it is killing only after entering the pass when it... (12 Replies)
Hi,
I simply want to kill a running process using a script that read pid from a file and tries to kill it .Getting error as shown below code..
cat $HOME/BackupScript.ksh.run | head -1 | while read pid
do
ps -p $pid > /dev/null 2>&1
if ; then
kill -9 $pid
else
echo "no running $pid... (5 Replies)
Hi All, Looking for a quick LINUX shell script which can continuously monitors the flle size, report the process which is creating a file greater than certain limit and also kill that process. Can someone please help me on this? (4 Replies)
Discussion started by: vasavimacherla
4 Replies
LEARN ABOUT SUSE
kill
KILL(1) User Commands KILL(1)NAME
kill - send signals to processes, or list signals
SYNOPSIS
kill [-s SIGNAL | -SIGNAL] PID...
kill -l [SIGNAL]...
kill -t [SIGNAL]...
DESCRIPTION
Send signals to processes, or list signals.
Mandatory arguments to long options are mandatory for short options too.
-s, --signal=SIGNAL, -SIGNAL
specify the name or number of the signal to be sent
-l, --list
list signal names, or convert signal names to/from numbers
-t, --table
print a table of signal information
--help display this help and exit
--version
output version information and exit
SIGNAL may be a signal name like `HUP', or a signal number like `1', or the exit status of a process terminated by a signal. PID is an
integer; if negative it identifies a process group.
NOTE: your shell may have its own version of kill, which usually supersedes the version described here. Please refer to your shell's docu-
mentation for details about the options it supports.
AUTHOR
Written by Paul Eggert.
REPORTING BUGS
Report kill bugs to bug-coreutils@gnu.org
GNU coreutils home page: <http://www.gnu.org/software/coreutils/>
General help using GNU software: <http://www.gnu.org/gethelp/>
COPYRIGHT
Copyright (C) 2009 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law.
SEE ALSO kill(2)
The full documentation for kill is maintained as a Texinfo manual. If the info and kill programs are properly installed at your site, the
command
info coreutils 'kill invocation'
should give you access to the complete manual.
GNU coreutils 7.1 July 2010 KILL(1)