close
» » Quick search in history of terminal

Quick search in history of terminal

Section: Other | Actuality: Linux Mint 19.1 Tessa
Quick search in history of terminal
On the Linux command line, you often need to re-run previous commands. Let's look at how to quickly find and, if necessary, change a command that you have already executed before.
If this is a relatively recent command, you can simply press the Up key until the command appears. But if the command has been used for a long time, it is not always convenient.
There is another very simple and convenient way to search the command history — is to use keyboard shortcuts:
Ctrl+R
At the command prompt, simple press Ctrl+R.
You will be taken to the command history search mode. The prompt on the command line changes to:
(reverse-i-search)`’:
Now you can start typing the name of the command you are looking for or any part of the command. That is, any sequence of characters from the command you want to find.
As you type the characters, the command history will be automatically searched according to the characters you enter, and if the corresponding command is found, it will be displayed on the command line.
Quick search in history of terminal
Press Ctrl+R again to move to the next command found. This is similar to navigating through the search results in a text editor when you use Ctrl+F.
The found command can be changed. To do this, press the Left or Right key to exit the search mode. The command appears on the command line and is editable.
To run the command, press Enter.
May the Force be with you,
Good Luck!!!

Print version

TOP OF THE MONTH
    Your favorite Linux distribution is Other polls