HSTR

Bash and Zsh shell history suggest box - easily view, navigate and search your command history with shell history completion that's faster and more efficient than Ctrl-r.

HSTR Demo

Why HSTR?

*

Intelligent History Search

Search your command history with keywords, regular expressions, or substring matching. HSTR provides multiple search modes to find exactly what you need, when you need it.

*

Metrics-Based Ranking

HSTR automatically ranks commands based on usage frequency and recency. Your most important commands are always at your fingertips.

*

Favorite Commands

Bookmark your favorite commands for instant access. Perfect for complex commands you use regularly but can't quite remember.

*

History Management

Delete obsolete commands or remove sensitive information from your history. Full control over your command history database.

*

Multiple Views

Switch between ranked history, raw chronological view, and favorites. Each view is optimized for different workflows.

*

Bash & Zsh Support

Works seamlessly with both bash and zsh. Easy configuration with automatic shell detection and setup scripts.

*

Case-Insensitive Search

Search without worrying about capitalization. HSTR's intelligent case-insensitive search finds what you need regardless of how you type it.

*

Customizable Interface

Configure colors, prompt position, help visibility, and more. Make HSTR look and behave exactly how you want it.

*

Cross-Platform

Available on Linux, macOS, BSD, and more. Install via package managers or build from source on virtually any Unix-like system.

Installation

Ubuntu/Debian

sudo apt install hstr

Fedora/RHEL/CentOS

sudo dnf install hstr

macOS (Homebrew)

brew install hstr

Arch Linux

yaourt -S hstr-git

Build from Source

git clone https://github.com/dvorka/hstr.git
cd hstr/build/tarball
./tarball-automake.sh
cd ../..
./configure && make
sudo make install

Configure

# Bash
hstr --show-bash-configuration >> ~/.bashrc
source ~/.bashrc

# Zsh
hstr --show-zsh-configuration >> ~/.zshrc
source ~/.zshrc

Get the Most Out of HSTR

Command Tagging

Add comments to commands for easy searching:

docker run -it ubuntu bash # DDD
ssh -L 8080:localhost:3000 user@server # SSS
git log --graph --oneline # GGG

Just type "DDD" in HSTR to find your Docker commands instantly!

Hide Sensitive Commands

Prevent commands from being saved to history:

# Bash
export HISTCONTROL=ignorespace

# Zsh
setopt HIST_IGNORE_SPACE

# Now use a leading space:
 secret-command --password=123

Keyboard Shortcuts

Master HSTR with these shortcuts:

Ctrl-r     - Invoke HSTR
Ctrl-/     - Toggle views
Ctrl-f     - Add to favorites
Ctrl-t     - Toggle case sensitivity
Ctrl-e     - Edit command
DEL        - Delete from history

Customize Appearance

Configure HSTR to match your style:

export HSTR_CONFIG=hicolor,prompt-bottom

# Options include:
# - hicolor / monochromatic
# - prompt-bottom
# - hide-help
# - raw-history-view
# - favorites-view

Increase History Size

Store more commands in your history:

export HISTFILESIZE=10000
export HISTSIZE=${HISTFILESIZE}
shopt -s histappend

Blacklist Commands

Exclude commands from ranking view:

export HSTR_CONFIG=blacklist

# Create ~/.hstr_blacklist:
cd
ls
pwd
exit

HSTR: History on Steroids

HSTR (HiSToRy) is a command line utility that brings improved bash/zsh command completion from the history. It aims to make completion easier and more efficient than the built-in Ctrl-r.

Are you looking for a command that you used recently? Do you want to avoid the need to write long commands over and over again? Are you looking for a tool that is able to manage your favorite commands? HSTR is the answer.

HSTR can also manage your command history - for instance you can remove commands that are obsolete or contain a piece of sensitive information, or bookmark your favorite commands.

10+
Years Active
4k+
GitHub Stars
15+
Platforms