Skip to content

Instantly share code, notes, and snippets.

@pfrozi
Created February 16, 2024 18:56
Show Gist options
  • Save pfrozi/8b703b11c3db92f7e01030175a0cd76b to your computer and use it in GitHub Desktop.
Save pfrozi/8b703b11c3db92f7e01030175a0cd76b to your computer and use it in GitHub Desktop.
Kill all processes with specific name
#!/bin/sh
# Call: killall forti
#
# Kill all process that contains the arg1 text
for p in `pgrep ${$1}`;
do echo "PID forti: ${p} Killing..." && kill $p && echo "${p} killed\!" ;
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment