history
. It would be nice to have a quick way to access something specific, complex or lengthy, especially if you already know how it starts.All you need to do to find a previous command, is to start entering the first few letters of it, then you can navigate all commands you previously issued that started with your entered phrase, by using the up/down arrows! Here's how you set it up:
In terminal, open or create:
gedit ~/.inputrc
Copy/paste the following there, and save (you may also have to close and reopen a terminal, or reload this way):
"\e[A": history-search-backward
"\e[B": history-search-forward
"\e[C": forward-char
"\e[D": backward-char
And done! Now, for example, if I am now looking for the command...
sudo apt-get update
...all I need to do is enter the first few letters, something like...
sud
...and scrolling up/down through my now-selective bash history will allow me to easily locate the command in its entirety for use again!
Adapted from: Ubuntu User Community
No comments :
Post a Comment