Instructions to set up a basic LAMP+SSH server environment
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

14 lines
366 B

#!/bin/sh
# Kills all matching processes
#
# Usage: sh processid_kill.sh process1 process2 process3 ...
#
for PIDS in $(ps l -C $@ | awk '{print $3}' | tail -n +2); do
for PID in $(echo $PIDS); do
kill $PID
done
done
# TODO: ignore case. For example, if user input is 'Vlc', ignore case and find process 'vlc' instead.
# This can be done with grep