Meniu

Search previous commands typed

If you want to see a collection of your previous commands used in Linux, you can always type ‘history’ for a listing of them. You can even search through history by grepping for the command you’re looking for, but then you’d have to copy/paste it into the terminal to run it again. Here’s a great shortcut to help you out!

Let’s say there was a long command you know you typed at some point but don’t remember the exact order of things within the command – or you just don’t feel like typing it all out again.

Use the reverse-i-search (ctrl-r)!

Start out at a command prompt. Hit the ctrl-r combination of keys..

(reverse-i-search)`': 

Now, simply start typing anything within the command you’re searching for. Once you see some results, keep hitting ctrl-r to cycle through history until you see the command you want! Hit enter to execute it or hit the left or right arrow key to edit it before you execute it.

If you can’t find what you’re looking for, ctrl-c out of the search.

Mirela

Zona de mobile
  • | 34 articole

Nici un comentariu inca. Fii primul!
  • powered by Verysign