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

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