Created
July 23, 2021 10:52
-
-
Save igilham/b716adc17825b9f7e57a33a44b5ef9a2 to your computer and use it in GitHub Desktop.
Fuzzy Kill script. Use `fzf` to locate a process to kill.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# Fuzzy find and kill a process. Supports signal codes (-9 etc.) | |
set -e | |
pid="$(ps -ef | fzf | awk '{ print $2}')" | |
kill $@ ${pid} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.