Created
July 13, 2019 01:32
-
-
Save Mimickal/a563ca6f4c79aef8ec504327647f86ce to your computer and use it in GitHub Desktop.
Fuzzy find scripts
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/bash | |
# This file contains a bunch of bash functions that use fzf (fuzzy find) to | |
# create more interactive UIs for existing utilities. | |
# cd into directory the selected file lives in | |
function fcd() { | |
file="$(locate --nofollow /* | fzf)" | |
path=$(dirname "$file") | |
cd "$path" | |
} | |
# Kills selected process by ID | |
function fkill() { | |
kill $(ps fux | fzf | sed 's/[a-zA-Z]* *\([0-9]*\).*/\1/') | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You can use this is by putting
source fuzzies.sh
in your.bashrc
(or whatever equivalent for your shell). These functions become available like any other CLI program.