From 5a7476a7745d7c4bf78cb4e8e615e01d68b58e73 Mon Sep 17 00:00:00 2001 From: Peter Daly-Dickson Date: Thu, 6 Nov 2014 20:55:11 +0000 Subject: [PATCH] Added ability to enter a few characters at the prompt and then search backwards/forwards through history with up and down arrows --- lib/history.bash | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/history.bash b/lib/history.bash index 92db21f9..f278e598 100644 --- a/lib/history.bash +++ b/lib/history.bash @@ -15,6 +15,11 @@ export HISTSIZE=5000 export AUTOFEATURE=true autotest +# enter a few characters and press UpArrow/DownArrow +# to search backwards/forwards through the history +bind '"":history-search-backward' +bind '"":history-search-forward' + function rh { history | awk '{a[$2]++}END{for(i in a){print a[i] " " i}}' | sort -rn | head }