Go2Linux | Linux Operating System

A site dedicated to: Linux Operating System

[CRTL+R] Search in your last used commands

Date: 2008-12-20 00:00:00 -0400

This is a Linux shortcut, it is very usable, and with it you will be able to search in your history of commands, by just starting to write the command, it is something like Firefox works, when you start typing an address, and it try to guess where you are trying to go.

Here is how it works.

At the command line press [CRTL+R], you will get something like this:

(reverse-i-search)`':

There you can start typing your command, and the shell will try guess your command based on your history of them.

something like this:

(reverse-i-search)`histor': history|awk '{print $2}'|awk 'BEGIN {FS="|"} {print $1}'|sort|uniq -c|sort

As you might see, I have only typed histor and the shell in reverse order have found the last command that started with that string.

If you liked this article please share it.

powered by TinyLetter

If you want to contact me in any other way, please use the contact page.