From 6e144bcba48c7fd7a707693874a9bb311afd2c33 Mon Sep 17 00:00:00 2001 From: Till Höppner Date: Mon, 15 May 2017 14:34:02 +0200 Subject: Add fuzzy cd/locate/kill --- functions/fd | 3 +++ functions/fkill | 7 +++++++ functions/fl | 3 +++ 3 files changed, 13 insertions(+) create mode 100644 functions/fd create mode 100644 functions/fkill create mode 100644 functions/fl diff --git a/functions/fd b/functions/fd new file mode 100644 index 0000000..16f54d6 --- /dev/null +++ b/functions/fd @@ -0,0 +1,3 @@ +# fda - including hidden directories +local dir +dir=$(find ${1:-.} -type d 2> /dev/null | fzf +m) && cd "$dir" 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 diff --git a/functions/fl b/functions/fl new file mode 100644 index 0000000..d73a525 --- /dev/null +++ b/functions/fl @@ -0,0 +1,3 @@ +# fda - including hidden directories +local dir +dir=$(locate / | fzf +m) && cd "$dir" -- cgit v1.2.3