The quickest way to work in Command Prompt is to use shortcut keys: Ctrl+C copies selected text, Ctrl+V pastes, Ctrl+A selects all, Ctrl+F opens search, and F7 shows your command history. These and a dozen more shortcuts turn a slow, click-heavy terminal into a fast tool once you learn them.
Why Shortcut Keys Matter in Command Prompt
Command Prompt (cmd.exe) has been part of Windows since the NT era. In the early days, you could only select text by right-clicking and choosing “Mark,” then dragging the mouse. That changed with Windows 10, which added native Ctrl+key shortcuts. Still, many users don’t realize how many hidden keys exist. Memorizing a few can save seconds on every command you type—seconds that add up when you’re renaming files, pinging servers, or running batch scripts.
Shortcut keys are especially useful when you’re working with long commands or repeating similar ones. Instead of retyping a long path, you can recall it from history, edit it quickly, and run it again. The shortcuts below work in the standard Command Prompt console on Windows 10 and Windows 11, and most also work in Windows Terminal when you’re using the Command Prompt profile.
Essential Copy, Paste, and Selection Shortcuts
These are the most commonly used shortcuts because they handle text manipulation, which is the core of any command-line session.
- Ctrl+C – Copies the selected text to the clipboard. If no text is selected, it sends an interrupt signal to the running command (like stopping a ping).
- Ctrl+V – Pastes text from the clipboard at the cursor.
- Ctrl+A – Selects all text on the current command line (not the entire screen).
- Ctrl+M – Toggles “Mark” mode, which lets you select text with the mouse or arrow keys. Once in Mark mode, press Enter to copy the selection.
- Ctrl+F – Opens the “Find” dialog to search the screen buffer for text.
- Ctrl+Shift+Plus (+) or Ctrl+Shift+Minus (-) – Adjusts transparency of the Command Prompt window (Windows 10 and later).
Note: In older Windows versions (before Windows 10), Ctrl+C and Ctrl+V didn’t work. You had to right-click to copy and paste. If you’re using an older system, those right-click methods still work.
Command Line Editing Shortcuts
These keys let you edit the current command without using the mouse. They’re essential for fixing typos or modifying a long path.
- Left/Right Arrow – Move the cursor one character left or right.
- Ctrl+Left/Right Arrow – Move the cursor one word left or right.
- Home – Move to the beginning of the line.
- End – Move to the end of the line.
- Backspace – Delete the character to the left of the cursor.
- Delete – Delete the character to the right of the cursor.
- Ctrl+Backspace – Delete the word to the left of the cursor (this works in Windows 10 and later).
- Insert – Toggle between insert and overwrite mode. In overwrite mode, typing replaces existing characters.
These editing keys work exactly like they do in a word processor, so they’re easy to pick up. The only difference is that you’re editing a single line, not a document.
Command History and Recall Shortcuts
Command Prompt keeps a history of every command you type in the current session. These shortcuts let you recall and reuse them.
- Up Arrow – Recall the previous command. Press repeatedly to go further back.
- Down Arrow – Recall the next command (after you’ve gone back).
- F7 – Opens a pop-up list of all commands in the history. Use the arrow keys to select one and press Enter to run it.
- F8 – Searches backward through history for a command that matches the text you’ve typed so far. For example, type “pi” and press F8 to find the last “ping” command.
- F9 – Prompts for a command number from the history list. The numbers are shown in the F7 pop-up.
- Alt+F7 – Clears the entire command history for the current session.
The F7 pop-up is particularly handy when you’ve run many commands and want to pick one without pressing Up Arrow dozens of times.
Function Key Shortcuts (F1–F9)
Function keys have specific roles in Command Prompt that date back to the DOS era. Some are still useful today.
- F1 – Pastes the previous command character by character. Each press of F1 adds one character from the last command.
- F2 – Copies the previous command up to a character you specify. Press F2, then type a character (e.g., “e”), and it copies everything before that character.
- F3 – Repeats the last command entirely.
- F4 – Deletes text from the current cursor position up to a character you specify. Press F4, then type a character.
- F5 – Similar to Up Arrow but does not cycle through commands that start with the same text; it goes through all history.
- F6 – Inserts the end-of-file marker (Ctrl+Z) at the cursor.
- F7 – Shows the command history pop-up (as above).
- F8 – Searches history as described.
- F9 – Runs a specific command by history number.
F1 and F2 are rarely used today because Ctrl+C and Ctrl+V are faster, but they’re still there if you need them.
Window and Display Shortcuts
These shortcuts control the Command Prompt window itself, not the commands inside it.
- Alt+Enter – Toggles full-screen mode. This works only when the window is in a standard console window, not in Windows Terminal.
- Ctrl+Scroll Wheel – Zooms in or out of the text (Windows 10 and later).
- Ctrl+Shift+Scroll Wheel – Scrolls the screen buffer horizontally (if there’s horizontal overflow).
- Ctrl+Home – Scrolls to the top of the screen buffer.
- Ctrl+End – Scrolls to the bottom of the screen buffer.
- Ctrl+Shift+W – Closes the Command Prompt window (works in Windows Terminal, not in the classic console).
If you use Windows Terminal instead of the classic console, many of these shortcuts are the same, but some (like Alt+Enter) may behave differently. Windows Terminal uses Ctrl+Shift+W to close a tab, for example.
Common Problems and Misconceptions
One common issue is that Ctrl+C doesn’t copy when you’ve selected text with the mouse. In the classic console, you must either enable “Use Ctrl+Shift+C/V as Copy/Paste” in the Properties > Options tab, or use the right-click menu. In Windows 10 and 11, Ctrl+C and Ctrl+V work by default, but if you’ve changed the settings, they might not.
Another misconception is that Ctrl+C always copies. In a command-line context, if no text is selected, Ctrl+C sends an interrupt signal (SIGINT) to the running process, which stops it. This is a holdover from Unix and is also present in cmd.exe. To copy, you must select text first, either by clicking and dragging or by using Ctrl+M to enter Mark mode.
People also confuse F3 with Up Arrow. F3 repeats the last command exactly, while Up Arrow also recalls the last command but allows you to edit it before pressing Enter. F3 is a quick way to re-run a command without editing, but Up Arrow is more flexible.
Finally, some users think shortcuts don’t work in Windows Terminal. Actually, most do, but Windows Terminal has its own set of shortcuts (like Ctrl+Shift+V for paste, or Ctrl+Shift+C for copy) that override the classic ones. You can change these in Windows Terminal’s settings if you prefer the classic behavior.
How to Customize Shortcut Keys
You can’t change the built-in shortcut keys in the classic Command Prompt—they’re hard-coded. However, you can change some behavior through the Properties dialog:
- Right-click the title bar of the Command Prompt window and select Properties.
- Go to the Options tab.
- Under “Edit Options,” check or uncheck “Use Ctrl+Shift+C/V as Copy/Paste” to enable or disable those shortcuts.
- Under “Command History,” you can change the buffer size (how many commands are remembered) and the number of buffers.
If you use Windows Terminal, you can fully remap shortcuts by editing the settings.json file. For example, you can change the paste shortcut from Ctrl+Shift+V to Ctrl+V. To do that, open Windows Terminal, press Ctrl+Comma, and go to Actions. There you can add a new keybinding.
For advanced users, you can also create custom keyboard macros using AutoHotkey or PowerShell, but that’s beyond the scope of this article.
Frequently Asked Questions
How do I copy text from Command Prompt without a mouse?
Press Ctrl+M to enter Mark mode, then use the arrow keys to highlight the text you want. Press Enter to copy the selection to the clipboard. Then you can paste it elsewhere with Ctrl+V.
Why doesn’t Ctrl+C copy in Command Prompt?
Ctrl+C only copies when text is selected. If nothing is selected, it acts as an interrupt signal to stop the current command. To copy, first select text by clicking and dragging, or by using Ctrl+M to enter Mark mode. Also check that the “Use Ctrl+Shift+C/V as Copy/Paste” option is enabled in Properties.
Can I use the same shortcuts in Windows Terminal?
Most shortcuts work, but Windows Terminal uses Ctrl+Shift+C for copy and Ctrl+Shift+V for paste by default. You can change these in the settings. Other shortcuts like F7, Up Arrow, and Ctrl+Arrow keys work the same way.
How do I clear the command history?
Press Alt+F7 to clear the history for the current session. To prevent history from being saved at all, you can run cmd /d or set the registry key HKCU\Software\Microsoft\Command Processor\DisableQuickEdit (though that’s not officially supported). The simplest is to just use Alt+F7.
Is there a shortcut to run a command as administrator?
There’s no direct shortcut inside Command Prompt. You need to open an elevated Command Prompt by right-clicking the Start button and selecting “Terminal (Admin)” or “Command Prompt (Admin).” You can also create a shortcut to cmd.exe and set “Run as administrator” in its properties.
What does F8 do exactly?
F8 searches backward through your command history for a command that starts with the text you’ve typed. For example, if you type “ip” and press F8, it will find the last command that starts with “ip,” such as “ipconfig.” If you press F8 again, it finds the next older match.
Related
- Battery Life Calculations: How to Estimate Runtime
- Dictionary Add or Update in C#: Best Way
- Does Java Have F Strings? (And What to Use Instead)
Try it: the Date Difference Calculator: days, months, years and weekdays between two dates, with the DATEDIF formulas.
More in How-to basics
- Can You Split One Cell in Excel? What Actually WorksNo—you cannot divide a single Excel cell into two or more independent cells. Excel’s grid is built from…
- Can You Auto Sort in Google Sheets? Setup and LimitsYes. Google Sheets can keep a separate, formula-generated view sorted as your data changes; to automatically reorder the…
- Excel Worksheet Tabs Not Visible? How to Restore ThemIf Excel worksheet tabs are not visible, first check File > Options > Advanced and turn on Show…
- Insert Data from an Image in Excel: Step-by-StepTo insert data from an image in Excel for Microsoft 365 on Windows, open the worksheet, select Data…
- How to Get Rid of Mail Merge in Word Without Losing TextTo get rid of mail merge in Word, first save a copy, then choose what should happen to…
- Excel Power Query: How to Group DataTo group data in Excel Power Query, select a column in the Power Query Editor, choose Home >…
Sources: Function behaviour and menu paths: Microsoft Support documentation for Excel. Method & sources
Spotted an error in this guide? Let us know.