Skip to content

Instantly share code, notes, and snippets.

@igilham
Created July 23, 2021 10:52
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save igilham/b716adc17825b9f7e57a33a44b5ef9a2 to your computer and use it in GitHub Desktop.
Save igilham/b716adc17825b9f7e57a33a44b5ef9a2 to your computer and use it in GitHub Desktop.
Fuzzy Kill script. Use `fzf` to locate a process to kill.
#!/bin/sh
# Fuzzy find and kill a process. Supports signal codes (-9 etc.)
set -e
pid="$(ps -ef | fzf | awk '{ print $2}')"
kill $@ ${pid}
@igilham
Copy link
Author

igilham commented Jul 23, 2021

fzf pops up a selection dialog with find-as-you-type, so it's much quicker than scrolling the terminal or grepping, then copy-pasting the pid into the kill command.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment