Skip to content

Instantly share code, notes, and snippets.

@eklect
Last active March 20, 2021 00:39
Show Gist options
  • Save eklect/db0f86a11629ee03dbdb9e1d1f577015 to your computer and use it in GitHub Desktop.
Save eklect/db0f86a11629ee03dbdb9e1d1f577015 to your computer and use it in GitHub Desktop.
Linux → Kill a process by an ID that is found by a keyword in its command
ps -ax | grep PROCESS_NAME_HERE | grep KEYWORD_HERE | awk '{print $1}' | xargs kill -9
#Example
# ps -ax | grep php | grep importData | awk '{print $1}' | xargs kill -9
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment