Darrell Norton's Blog [MVP]

Sponsors

The Lounge

Wicked Cool Jobs

News

  • Darrell Norton pic

    MVP logo

    View Darrell Norton's profile on LinkedIn

    Currently Reading:

    weewar.com

Advertisement

Images in this post missing? We recently lost them in a site migration. We're working to restore these as you read this. Should you need an image in an emergency, please contact us at imagehelp@codebetter.com
Cmd window shortcut shows previously entered commands

I just found a cool cmd window feature (from Windows and .NET Magazine).  If you press F7 in a cmd window, you will get a list of all the previously entered commands in order.  When you can pick one, the cmd window executes it. Try this:

  1. Go to Start/Run
  2. Type in cmd and hit Enter
  3. Type in ipconfig and hit Enter
  4. Type in cls and hit Enter
  5. Now hit the F7 key, and you should see something like this:
     The menu you get when you hit F7 in a cmd window
  6. You can move the selection using the arrow keys.  When the command you want is highlighted, press Enter and it will execute it.

Posted Wed, Feb 4 2004 11:42 AM by Darrell Norton
Filed under:

[Advertisement]

Comments

Donny Mack wrote re: Cmd window shortcut shows previously entered commands
on Wed, Feb 4 2004 7:33 AM
nice, i never knew that and use cmd all the time.
Darrell wrote re: Cmd window shortcut shows previously entered commands
on Wed, Feb 4 2004 8:03 AM
Same here. If you just want to reuse the previous command, the up arrow works great. But when there are several, or you've used the same command with different parameters, it's easier to use F7.
Jeff wrote re: Cmd window shortcut shows previously entered commands
on Wed, Feb 4 2004 8:22 AM
Hasn't this been around since early versions of DOS?
Julien CHEYSSIAL wrote re: Cmd window shortcut shows previously entered commands
on Wed, Feb 4 2004 9:09 AM
Wow !!! really didn't know that one !
Darrell wrote re: Cmd window shortcut shows previously entered commands
on Wed, Feb 4 2004 9:13 AM
Jeff, sure looks like it doesn't it? Looks like the menu system in the old dos EDIT editor.
Rob Walker wrote re: Cmd window shortcut shows previously entered commands
on Wed, Feb 4 2004 6:04 PM
That is pretty slick. I will be showing it to the folks at work tommorow.

On another note.

If you hold down the ALT key and then press the tab key you can switch your focus between running programs.
Vijay wrote re: Cmd window shortcut shows previously entered commands
on Thu, Feb 5 2004 2:30 AM
Yeah even i think it's been around for a long time ... It comes with the DOSKEY utility command that comes along with CMD shell. Can't think of exactly when this was introduced but maybe if someone has Win98 or earlier, you can check this out there !
Vijay wrote re: Cmd window shortcut shows previously entered commands
on Thu, Feb 5 2004 2:32 AM
In fact F9 lets you go to the command by entering its number in the list ( shown by F7 ).

And Alt F7 clears the buffer that shows all the list of previously executed commands too.
都こんぶ(猪股健太郎の雑記) wrote cmd.exeでコマンドの履歴を見る
on Thu, Feb 5 2004 5:51 PM
F7?????????!
Mark Hurd wrote re: Cmd window shortcut shows previously entered commands
on Fri, Feb 6 2004 12:46 PM
Note that these command line editing features are available to other CLI programs too.

I've been using DotLisp interactively through CMD a lot and there's a number of line editing and history shortcuts that are rather useful to remember.

Some of the choice ones:
Up/down arrows - 'scrolls' through command history -- leaves cursor at end of line

F8 - 'cycles' through matches in command history to the text to the left of the cursor -- cursor doesn't move

Ctrl+End - Deletes to the end of the line

Ctrl+Home - Deletes to the beginning of the line.

There are others, like deleting to a character(F4), which are a bit more esoteric and I find I only remember they'd have been useful after I've completed the edit.
Darrell wrote re: Cmd window shortcut shows previously entered commands
on Sat, Feb 7 2004 4:06 AM
Mark - very cool. Thanks for all the shortcuts!
pitiot wrote re: Cmd window shortcut shows previously entered commands
on Tue, May 11 2004 5:43 AM
Yes it is cool but i was looking for a list with this kind of commands not for this command :P Does anybody know where can i find them?
Darrell wrote re: Cmd window shortcut shows previously entered commands
on Tue, May 11 2004 6:19 AM
Pitiot - I don't know what you are asking for?
anon wrote re: Cmd window shortcut shows previously entered commands
on Fri, May 21 2004 5:40 PM
For a list of commands, just type the command "help".
Devlicio.us