Search your bash history
You can enable searching your bash history via arrow keys(or other keys) via the following commands(best served via .bashrc):
if [ -n "$PS1" ]; then
bind '"\C-[[A": history-search-backward'
bind '"\C-[[B": history-search-forward'
fi
So next time when typed half-way through your command, just hit your up-key. As an example:
$> ssh yo↑
This will search your bash history for commands starting with "ssh yo" on every up-keypress. So you might see:
$> ssh yo↑
$> ssh your-server↑
$> ssh your-other-server
Written by Maik Kulbe
Related protips
2 Responses
I have this on my system and I have no idea where it came from, but my instincts tell me it came with zsh.
over 1 year ago
·
@koddsson I'm not using zsh but I heard it brings this feature with it(or I guess at least oh-my-zsh does)
over 1 year ago
·
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Shell
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#