【问题标题】:What is the fastest way to get the previous command in shell?在 shell 中获取上一个命令的最快方法是什么?
【发布时间】:2021-08-03 15:06:24
【问题描述】:

我在 UNIX 中,在 shell 中获取上一个命令的最快方法是什么?现在我正在使用!:0 来获取上一个命令,但我不确定是否有更好的选择。假设我有这个:

git add .
!:0 commit -m "Inital" //!:0 will be git

有没有更快的方法? !:0 不好打。

【问题讨论】:

标签: linux


【解决方案1】:

我使用终端上的向上箭头来获取我运行的最新命令,您也可以使用历史记录,并使用历史记录运行任何命令!。

【讨论】:

    猜你喜欢
    • 2010-09-17
    • 1970-01-01
    • 2015-10-02
    • 2017-05-17
    • 2016-01-08
    • 1970-01-01
    • 2019-07-08
    • 2017-10-25
    • 1970-01-01
    相关资源
    最近更新 更多