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.

>doskey/?

<edit>
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.

F7

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.

F8

This entry was posted in cmd, tips and tricks by Josh. Bookmark the permalink.

About Josh

I signed up for a BASIC class in junior high. That got me hooked and pretty soon I started experimenting with harder languages. My college years are a blur of benders hopped up on Perl and Java and that one semester where I sunk so low that I was mainlining Smalltalk. Now I'm a complete C# junky living it one day at a time. Hello, my name is Josh.

Leave a Reply

Your email address will not be published. Required fields are marked *

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