Skip to content

Instantly share code, notes, and snippets.

@tukkek
Last active October 4, 2025 23:46
Show Gist options
  • Select an option

  • Save tukkek/a13fd17db317edf41fe78cbe42ca9c75 to your computer and use it in GitHub Desktop.

Select an option

Save tukkek/a13fd17db317edf41fe78cbe42ca9c75 to your computer and use it in GitHub Desktop.
Linux terminal history utility
#!/usr/bin/bash
# 1. Install Fuzzy Finder: apt-get install fzf
# 2. Place this script on your $PATH
# 3. Add to your ~/.bashrc file:
# alias "?=source history.sh"
# 4. Use the ? alias to search and select commands
cmd=`history|cut -c 8-|tac|fzf --reverse --scheme=history`
eval "$cmd"
history -s "$cmd"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment