Run the last executed command in Windows command prompt
When u开发者_开发问答sing UNIX I use to type !!
to run the last executed command.
How could I do the similar kind of operation on Windows command prompt?
↑ followed by Enter
You can also use F7 to navigate the command history. F1 will recover the last command character by character.
Windows PowerShell
ihy
Invoke-History
Sometimes (if you didn't press F9 & didn't choose an older command and if you didn't navigate through history using the keys F5 / F7), the following keys can work in cmd:
- F3 - gets the last command
- F5 - gets the last command when you press it for the first time, then it iterates through the commands history
- F8 - gets the last command when you press it for the first time, then it iterates through the commands history (it can also go from the first one to the last one)
A description for the functions above can be found on the Microsoft website.
You can just use the up and down arrows or F3
精彩评论