When you try to find a previous used command in an interactive shell session by ↑ (up arrow), you may get something like
$ls # 1st time push `up arrow`
$ls # 2nd time push `up arrow`
$ls # 3rd time push `up arrow`
$ls # 4th time push `up arrow`
$ls # 5th time push `up arrow`
$ls # 6th time push `up arrow`
$make # 7th time push `up arrow`
$make # 8th time push `up arrow`
$make # 9th time push `up arrow`
$ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" # Bingo!
I would like it better if it were like this:
$ls # 1st time push `up arrow`
$make # 2th time push `up arrow`
$ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" # Bingo!
because the duplicated history is usually of no use.
How can I get Bash to do this?
ruby
command by typing!r
(Enter), right? – G-Man Says 'Reinstate Monica' Jul 27 '22 at 01:08