Pages

Reverse search in shell

I didn't know about it earlier. So I thought of writing about it.

If you are or shell user, there have been some situations where you have solved some problems with some shell commands. Then you remember only a part of the command and when you need the same command again, you can't remember exactly what the command was. Well, this is for people like you.

Reverse search helps you find the command you have typed in the past, with a little bit of help from you. It takes small fragment of command how much you remember, and suggests similar command you have applied in the past.

How to use it?

  • Press Ctrl + R in the shell
  • Type how much of the command you could remember
  • Use the arrow key, or Ctrl + R again to find the correct command
  • Press Enter finally when you found it.
  • Press Ctrl + G to get out of the search mode.

No comments:

Post a Comment

If you like to say anything (good/bad), Please do not hesitate...