Both methods below are almost equivalent, it just depends on which file you want to edit. I'd recommend .bashrc
myself, as it doesn't involve editing a local copy of a system file.
If you experience any problems with this, please comment below so that it can be fixed.
- Edit
~/.bashrc
with this command:
gedit ~/.bashrc
- Add the following lines:
bind '"\e[A": history-search-backward'
bind '"\e[B": history-search-forward'
- Save then close the file.
- Execute this command in a terminal:
source ~/.bashrc
- Execute this command in a terminal:
cp /etc/inputrc ~/.inputrc
- Edit the new
~/.inputrc
file with this command:
gedit ~/.inputrc
- Append these lines to the file:
"\e[A": history-search-backward
"\e[B": history-search-forward