Many times power users, administrators and developers use Command Prompt in Windows to execute various commands. Today in this topic, we are going to put a comprehensive list of all useful keyboard shortcuts for Command Prompt which can help you in executing the commands quickly and easily.
Up Arrow or F5: Cycles through previous commands from command history
If you have run commands in a Command Prompt window, you can press "Up" key to cycle through them. Press "Down" key to go the next command.
Pressing "F5" key also does the same job.
Tab: Auto-fills file/folder names
If you type a character and press "Tab" key, it'll automatically fill the matching file/folder name present in the current directory. You can cycle through all matching names by pressing "Tab" key continuously.
Right Arrow or F1: Auto-fills characters from previous command one by one
If you press "Right" key or "F1" key, it'll start typing characters from the previously executed command one by one.
F2: Copies characters from previous command
If you want to copy certain number of characters from previously executed command, you can press "F2" key. It'll ask the character name to copy up to, type the character name and press Enter.
For example, you executed CD Windows command. Now if you press "F2" key and type o when it asks for "Enter char to copy up to", it'll automatically copy and fill CD Wind in Command Prompt.
Esc: Erases current line
If you type a command but don't want to execute it, simply press "Esc" key and it'll erase the typed line.
F3: Repeats last command
You can automatically fill the previously executed command by pressing "F3" key. When you press "F3" key, it repeats the last command.
F7: Shows list of all previous commands from command history
You can press "F7" key to get a list of all previously executed commands and then you can use Up or Down arrow keys to cycle though them. Press Enter to execute the selected command.
F9: Asks for command number and executes it
Its similar to "F7" key. You just need to remember the number of a previously executed command, press "F9" key and it'll ask "Enter command number". Type the command number and press Enter and it'll execute the command.
F8: Type character and press F8 key to cycle though matching commands
Type a few characters and press "F8" key and it'll automatically fill the matching command. Keep pressing "F8" key will cycle though all matching commands.
Alt+F7: Clears command history
You can clear the whole command history by pressing "Alt" and "F7" keys together.
Ctrl+Shift+Enter: Opens Command Prompt as Administrator
Click on Start ORB and type cmd in search box. Now press Ctrl+Shift+Enter keys together and it'll open an elevated Command Prompt window i.e. Command Prompt as Administrator.