summaryrefslogtreecommitdiff
path: root/functions/fkill
diff options
context:
space:
mode:
authorTill Höppner2017-05-15 14:34:02 +0200
committerTill Höppner2017-05-15 14:34:02 +0200
commit6e144bcba48c7fd7a707693874a9bb311afd2c33 (patch)
tree43b9166c5d6817f01312f22a0fcd846a06dc69f4 /functions/fkill
parentd027cc4db3c84e0333b1b3136484b412a2f86a67 (diff)
downloadzsh-6e144bcba48c7fd7a707693874a9bb311afd2c33.tar.gz
zsh-6e144bcba48c7fd7a707693874a9bb311afd2c33.tar.xz
zsh-6e144bcba48c7fd7a707693874a9bb311afd2c33.zip
Add fuzzy cd/locate/kill
Diffstat (limited to 'functions/fkill')
-rw-r--r--functions/fkill7
1 files changed, 7 insertions, 0 deletions
diff --git a/functions/fkill b/functions/fkill
new file mode 100644
index 0000000..799fdbe
--- /dev/null
+++ b/functions/fkill
@@ -0,0 +1,7 @@
+local pid
+pid=$(ps -ef | sed 1d | fzf -m | awk '{print $2}')
+
+if [ "x$pid" != "x" ]
+then
+ echo $pid | xargs kill -${1:-9}
+fi