F8 in CMD: The Greatest Thing Since Sliced Bread

I recently stumbled across DOSKEY while reading StackOverflow.  Reading the documentation I stumbled across something old and something new.


F7    Displays command history
F8    Searches command history

I knew about F7 and use it constantly when I’m on the command line.  It pops up a scrollable list of your recent commands.


F8 lets you cycle through commands in your history with a search term.

Suppose you had previously typed a complex command.  In the example I have below, I used the command “echo Foxtrot Golf”.  To find and execute it again all you need to do is type the beginning of the command and then press the F8 key.  In the example, I type “echo” on the command prompt and cycle through all the commands that start with that by pressing F8.  To narrow it down a bit more, I type in “echo F” and then press F8 to get all the commands that start with that.  Note that it is case sensitive.