Ctrl+R to look and different terminal historical past methods

Google+ Pinterest LinkedIn Tumblr +

Terminal energy customers already know log of all of the instructions you execute are stored in historical past. (Go forward, kind historical past to see them.) Last week we noticed you could sudo your previous command utilizing the !! (bang-bang) notation. Well, you may also search your command historical past as you kind utilizing the very helpful Ctrl+R key mixture.

Give it a strive: within the terminal, maintain down Ctrl and press R to invoke “reverse-i-search.” Type a letter – like s – and you will get a match for the newest command in your historical past that begins with s. Keep typing to slim your match. When you hit the jackpot, press Enter to execute the instructed command.

Also, !characters will execute the final command that matches the desired characters. (So !ssh will run the final ssh you used.)

Of course good historical past search solely works in the event you’ve obtained an extended historical past. To prolong the size of the historical past listing in your terminal, add the next traces to your .bash_profile:


Once you have obtained your historical past constructed up, you need to use this command to see what gadgets you kind within the terminal probably the most. (Great solution to resolve what aliases you might want to arrange.) What are your favourite terminal historical past methods? Let us know within the feedback. Thanks, Tom!

What’s in your bash History? [ONLamp]

Read more


Leave a Reply

%d bloggers like this: