简体   繁体   English

在Windows命令提示符下运行上次执行的命令

[英]Run the last executed command in Windows command prompt

When using UNIX I use to type !! 使用UNIX时我用来键入!! to run the last executed command. 运行最后执行的命令。

How could I do the similar kind of operation on Windows command prompt? 如何在Windows命令提示符下执行类似的操作?

紧接着是Enter

You can also use F7 to navigate the command history. 您还可以使用F7导航命令历史记录。 F1 will recover the last command character by character. F1将逐个字符地恢复最后一个命令。

Windows PowerShell 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 : 有时 (如果您没有按F9并且没有选择较旧的命令,并且如果您没有使用F5 / F7键浏览历史记录),则以下键可以在cmd中工作:

  • F3 - gets the last command F3 - 获取最后一个命令
  • F5 - gets the last command when you press it for the first time, then it iterates through the commands history F5 - 第一次按下它时获取最后一个命令,然后迭代命令历史记录
  • 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) F8 - 第一次按下它时获取最后一个命令,然后迭代命令历史记录(它也可以从第一个命令转到最后一个命令)

A description for the functions above can be found on the Microsoft website . 有关上述功能的说明,请访问Microsoft网站

您可以使用向上和向下箭头或F3

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM