Command Prompt Shortcuts: History Keys, Copy and Paste, and Quick Ways to Open CMD
The Command Prompt keyboard shortcuts worth learning, the Windows Terminal keys that go with them, and fast ways to open cmd or make a desktop shortcut.
By PC MomentUpdated 7 min read

The Command Prompt shortcut most people never learn is F7: it pops up a list of every command you’ve run in that window, so you can pick one and run it again. Add Tab to complete file names and Ctrl + C / Ctrl + V to copy and paste, and you’ll spend a lot less time retyping.
This guide covers the shortcuts that work inside Command Prompt on Windows 10 and 11, the Windows Terminal keys that go with them, and the fastest ways to open cmd or put a shortcut to it on your desktop.
Note: On Windows 11, Command Prompt often opens inside Windows Terminal (Microsoft made Terminal the default console host in Windows 11 version 22H2). The cmd history and editing keys below work in both. The Windows Terminal section lists the extra keys for tabs and panes.
Quick ways to open Command Prompt
| Method | How |
|---|---|
| Run dialog | Press Windows key + R, type cmd, press Enter |
| Start search | Press the Windows key, type cmd, press Enter |
| File Explorer address bar | Click the address bar, type cmd, press Enter to open cmd in that folder |
| Windows Terminal | Open the new tab dropdown with Ctrl + Shift + Space and choose Command Prompt |
| As administrator | Type cmd in Start search, then press Ctrl + Shift + Enter |
The File Explorer trick is the one to remember if you work with files: Microsoft notes that typing cmd in the address bar launches the command shell at that location, so you don’t have to cd your way there. For all the ways to get admin rights, see our guide to the elevated command prompt.
Command history shortcuts
Command Prompt remembers what you’ve typed in the current window. These keys come from Microsoft’s doskey reference:
| Key | What it does |
|---|---|
| Up arrow | Recalls the command before the one shown |
| Down arrow | Recalls the command after the one shown |
| Page Up | Recalls the first command of the session |
| Page Down | Recalls the most recent command |
| F7 | Shows all stored commands in a pop-up list |
| F8 | Shows commands that start with what you’ve already typed |
| F9 | Asks for a command number from the F7 list and recalls that command |
| Alt + F7 | Deletes all stored commands for the current history |
| Esc | Clears the current line |
F8 is the hidden gem. Type ipconfig, press F8, and it cycles through only the earlier commands that started with ipconfig.
To save your history to a file, run:
doskey /history > commands.txt
This writes every command stored in memory to commands.txt in the current folder.
Editing the command line
| Key | What it does |
|---|---|
| Left / Right arrow | Moves the cursor one character |
| Ctrl + Left / Right arrow | Moves the cursor one word |
| Home / End | Jumps to the start or end of the line |
| Insert | Switches between inserting and overwriting text |
| F1 | Copies the next character from your last command |
| F2 | Copies your last command up to the character you type next |
| F3 | Copies the rest of your last command |
| F4 | Deletes from the cursor up to the character you type next |
| F5 | Copies your last command into the current line |
F3 is useful after a typo near the end of a long command: retype the start and press F3 to fill in the rest.
Tab completion for files and folders
Start typing a file or folder name and press Tab. Microsoft’s Windows commands reference says Tab is the default completion key for both file and directory names, so Command Prompt fills in a matching name for you. Microsoft’s cmd reference adds that completion handles names with spaces or special characters correctly when the path is in quotation marks.
Copy, paste and select text
Microsoft lists these Command Prompt shortcuts for both Windows 10 and Windows 11:
| Shortcut | What it does |
|---|---|
| Ctrl + C or Ctrl + Insert | Copies the selected text |
| Ctrl + V or Shift + Insert | Pastes text |
| Ctrl + M | Enters Mark mode so you can select with the keyboard |
| Alt + selection | Starts a block (rectangular) selection |
| Ctrl + Home / Ctrl + End (Mark mode) | Moves to the start or end of the buffer |
| Ctrl + Up / Down arrow | Moves up or down one line in the output history |
Ctrl + C when nothing is selected
If no text is selected, Ctrl + C isn’t a copy. Microsoft’s console documentation explains that it’s sent as an interrupt signal to the program running in the window. That’s the usual way to interrupt a command that’s taking too long, although a program can choose to handle the signal differently. Windows Terminal works the same way: Ctrl + C copies when there’s a selection and otherwise passes the keystroke to the shell.
Windows Terminal shortcuts
If your Command Prompt runs inside Windows Terminal, these default key bindings are available too:
| Shortcut | What it does |
|---|---|
| Ctrl + Shift + T | Opens a new tab |
| Ctrl + Shift + 1 to 9 | Opens a new tab with profile 1 to 9 from the dropdown |
| Ctrl + Shift + Space | Opens the new tab dropdown |
| Ctrl + Shift + D | Duplicates the current tab |
| Ctrl + Shift + W | Closes the current pane |
| Ctrl + Tab / Ctrl + Shift + Tab | Next / previous tab |
| Ctrl + Alt + 1 to 8 | Jumps to a specific tab |
| Alt + Shift + D | Splits the pane |
| Alt + arrow keys | Moves focus between panes |
| Ctrl + Shift + F | Finds text in the output |
| Ctrl + Shift + P | Opens the command palette |
| Ctrl + , | Opens Settings |
| Ctrl + plus / minus / 0 | Changes or resets the font size |
| Alt + Enter or F11 | Toggles full screen |
| Ctrl + Shift + N | Opens a new window |
Tip: Can’t remember a shortcut? Press Ctrl + Shift + P, start typing what you want (for example “split”), and the command palette shows the matching action and its key.
Create a Command Prompt desktop shortcut
A desktop icon is handy if you open cmd many times a day:
- Right-click an empty area of the desktop.
- Select New > Shortcut.
- When asked for the location of the item, type
cmd.exeand select Next. - Type a name, such as Command Prompt, and select Finish.
You can make the shortcut run a command when it opens by adding /k. Microsoft’s cmd reference says /k carries out the command and keeps the window open. For example, use this as the location to open cmd and immediately show your network settings:
cmd.exe /k ipconfig
Bonus: make your own command shortcuts with doskey
doskey macros let you create short names for longer commands in the current window. For example:
doskey ls=dir $*
This makes ls run dir, passing along anything you type after it (that’s what $* does). Run doskey /macros to list the macros you’ve defined.
If it still doesn’t work
- F7 or F8 does nothing: You may be in PowerShell rather than Command Prompt. Microsoft explains that PowerShell’s command line behavior comes from its own PSReadLine module, so the doskey keys described here are for cmd. Open a Command Prompt tab or type
cmdfirst. - A program ignores the keys: Microsoft notes that a program’s own key assignments override doskey keys. Some full-screen tools use F7 for something else.
- Ctrl + V doesn’t paste in Windows Terminal: Check that you haven’t unbound or reassigned it in Terminal settings. Shift + Insert and Ctrl + Shift + V are also default paste keys.
For keyboard shortcuts outside the command line, see our list of computer tricks and the guide on how to print screen on Windows 11. Browse more in Tech Tips.
Frequently asked questions
What is the shortcut to open Command Prompt?
Press Windows key + R, type cmd and press Enter. You can also press the Windows key, type cmd and press Enter, or type cmd in File Explorer's address bar to open it in that folder.
How do I see my previous commands in Command Prompt?
Press F7 to open a list of the commands you've run in that window, then use the arrow keys and Enter to run one again. The Up arrow recalls commands one at a time, and doskey /history prints the whole list.
How do I copy and paste in Command Prompt?
Select text and press Ctrl + C (or Ctrl + Insert) to copy, and press Ctrl + V (or Shift + Insert) to paste. Ctrl + M enters Mark mode so you can select text with the keyboard.
How do I open a new tab in Windows Terminal?
Press Ctrl + Shift + T for a new tab with your default profile, or Ctrl + Shift + 1 through 9 to open a specific profile from the dropdown list.
Related guides

Tech Tips
Elevated Command Prompt: How to Open CMD as Administrator in Windows 10 and 11
Six reliable ways to open an elevated Command Prompt in Windows 10 and 11, what elevation means, and how to check you're actually running as admin.
7 min read

Tech Tips
15 Computer Tricks for Windows 10 and 11 That Save Real Time
Fifteen genuinely useful Windows tricks, from clipboard history and Snap layouts to a hidden battery report, all built into Windows 10 and 11.
7 min read

Tech Tips
Windows Emoji Keyboard Shortcut: Emoji, Kaomoji, Symbols and GIFs
Press Windows key + period to open the emoji panel in Windows 10 and 11. Here's how to search it, find symbols and kaomoji, and use clipboard history.
6 min read

Tech Tips
How to Print Screen on Windows 11: Every Way to Take a Screenshot
Every way to screenshot on Windows 11, from the Print Screen key to Snipping Tool and Game Bar, plus where each one saves your image.
7 min read

Tech Tips
Google Search Tricks That Still Work: Operators, Filters and Image Search
The Google search operators Google still documents, which old ones are gone, and the filters and image tools that find things faster.
6 min read