brewedbits.dev

Personal blog with guides and news on selfhosting, Linux and AI, from the Netherlands

nextDash nextdash --aboutYour bookmarks. Your terminal. checks your links knows your Docker host one container, no cloudLive demo →nextdash.cc ↗

Tip: fzf turns Ctrl-R into a fuzzy search of your shell history

Shell
~/tips/fzf-history

eval "$(fzf --bash)"

Replaces Ctrl-R with a fuzzy, live-filtered search of your shell history.

Plain Ctrl-R makes you type an exact piece of the old command. With fzf you type a few letters from anywhere in it and pick from a live list.

Install fzf with your package manager, then add one line to your shell config (this needs fzf 0.48 or newer):

# ~/.bashrc
eval "$(fzf --bash)"

# ~/.zshrc
source <(fzf --zsh)

After you restart the shell, Ctrl-R opens a fuzzy search of your history. The same line also gives you Ctrl-T to paste a file path and Alt-C to jump into a folder.

Caveat: older fzf versions do not know --bash or --zsh. They ship a separate key-bindings script that you source instead, and the README of your version says where it is.

Further reading: fzf on GitHub

More Shell tips zmv -n '(*).log' '$1.txt' zoxide query -ls project f=$(mktemp --suffix=.json) shopt globskipdots echo $EPOCHSECONDS All Shell tips (78) All topics

Link