CommandCross-platform

Tome of History

Search Shell Command History with Fuzzy Finder

Interactively search through shell history using fuzzy matching, then execute or edit the selected command. Dramatically speeds up recalling complex commands.

history | fzf --tac --no-sort | sed 's/^[ ]*[0-9]*[ ]*//' | xargs -I {} bash -c '{}'

Usage Notes

  • --tac reverses order so recent commands appear first
  • --no-sort preserves chronological order during search
  • Press Enter to execute, Ctrl+C to cancel
  • For zsh, use fc -l 1 instead of history
  • Install fzf: brew install fzf or apt install fzf
  • Consider adding as shell alias for quick access

Warnings

Executes the selected command immediately. Review the command before pressing Enter.

Related Scroll Ideas

  • • Fuzzy find and cd into directory
  • • Search and open file in editor
  • • Interactive git branch switcher