How To Recall Typed Commands In Linux?

by Keith Dsouza | Translate | Print
Monday, 22nd Sep 2008 | Share


Share How To Recall Typed Commands In Linux? on Twitter Share How To Recall Typed Commands In Linux? on Facebook Save How To Recall Typed Commands In Linux? To Delicious Favorites Stumble How To Recall Typed Commands In Linux? Share How To Recall Typed Commands In Linux? on Digg Get Instant Updates as RSS Feeds from Techie Buzz

For me Linux has always been a Command Line Interface (CLI) as opposed to a Graphical User Interface (GUI), learning commands the hard way is the best way to remember them, but why type over commands that you have already typed in a current or previous session in the console?

Here is a simple tip that will help you iterate through several commands you have typed in earlier on a *nix based console.

Instead of typing each and every command you have already typed, here are some simple steps that will save you time while recalling older commands you have already typed in the current or earlier sessions.

Step 1: Type Ctrl + R before issuing a command, this initiates the command re-caller in backward mode (most recent first).

Step 2: Type in few characters or part of the command u want to search for, for example if you want to lookup sudo commands you have typed in the past, just type in sudo.

Step 3: To scroll through past commands, keep using Ctrl + R till you find the command you are looking for.

Step 4: Hit enter when you find the command you want. or Ctrl + C to break the iteration loop.

Bonus Step: If you skipped through the command you wanted, you don’t have to start the search once again, just use Shift + Ctrl + R in the same loop to re-iterate through the commands in forward mode.

And for the bonus tip of this Linux Tips episode, just type in “history” and hit enter to see a list of commands you have typed in the current session as well as previous sessions.



Share

No Responses so far | Share Your Opinions!

Leave a Comment

Note: We discourage users from using keywords in their names while posting comments, most of them get caught by spam, also it really would be more fruitful in knowing people who comment by their real name, rather than by using a name no one relates to. In future we reserve the right to delete comments from users using a name other than their own.

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>