Views
Download: killp
Select processes to signal (generally, terminate) according to their command line launch text. There's lots of features - killp -? tells you all the options. Here's the script documentation comments:
# Killp:
# - reports each running process whose command contains an egrep-style
# match for the text on the killp command line
# - solicits confirmation from the user for sending a signal to each target
# - on each confirmation, reports whether the signal was succesfully
# delivered (the user, eg, might not be privileged to signal that process)
# - proceeds to the next qualifying process
# The user can designate the signal to be sent just as they would with
# the shell 'kill' command. 'TERM' is accordingly the default signal.
# Additionally, the user can restrict the candidate process to just
# those running under the users uid, with the '-m' option.
# killp can be run non-interactively. It only lists the qualified
# candidates, delivering no signals, when the '-n' option is
# specified. It delivers the designated signal to all qualified
# candidates if the '-y' option is specified. (The '-n' option takes
# precedence.)
# A '--' command line option indicates that all following arguments
# are to be taken as the match pattern. This is useful if the initial
# character of the match pattern is a '-'.
# Each prompt includes the sequence number of the candidate process,
# the total number of processes, the pid of the candidate, the command
# text as ps sees it, the pending signal, the set of valid responses,
# and then the default response, which will be sent on null input from
# the user. The initial default response is no ('n').
# The prompting provides a number of options. The valid responses are:
#
# y - yes
# n - no
# Y - yes, and set default response to 'y'
# N - no, and set default response to 'n'
# g - 'go' - don't ask, just show rest of candidates and do default action
# q - 'quit' - no more killing, exit immediately
# ? - show this message
#
# The 'g' response allows the user to indicate that all the remaining
# candidates should be treated with the default response, which can
# first be reset to 'y' or 'n' using the 'Y' or 'N' responses.