Answer the question
In order to leave comments, you need to log in
How to set up work with command history in Linux?
The command line has the ability to work with the history of not only commands, but also arguments. For example, if you type a command and press the up button, you can view the history for that particular command.
Tell me, what package should be installed in order for the history to work in this format?
Answer the question
In order to leave comments, you need to log in
I have this set up in ~/.bashrc:
# History search with Up/Down keys.
if ; then
bind '"\eOA": history-search-backward'
bind '"\e[A": history-search-backward'
bind '"\eOB": history-search-forward'
bind '"\e[B": history-search-forward'
fi
Press Ctrl-R, start typing the command, you will see the option from the history. You can continue typing and the suggested options will change if the characters you type do not match the previously suggested option. And you can at any time press Ctrl-R a few more times and immediately select from other historical options. To return to the missed option - Ctrl-Shift-R.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question