Skip to content

Instantly share code, notes, and snippets.

@rbudiharso
Last active April 22, 2020 09:17
Show Gist options
  • Save rbudiharso/e8212f9c91b9e36a4b142e0f71fe0ff9 to your computer and use it in GitHub Desktop.
Save rbudiharso/e8212f9c91b9e36a4b142e0f71fe0ff9 to your computer and use it in GitHub Desktop.
# put this function in your .bashrc or .zshrc and call shf for easy host selection
# requirements:
# - grep
# - fzf
ssf() {
host=$(grep -e "^Host " ~/.ssh/config | awk '{print $2}' | fzf)
echo "SSH session started, connecting to" $host
ssh $host
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment