是否有命令可以调用上一条编辑命令并记住光标位置?

是否有命令可以调用上一条编辑命令并记住光标位置?

我的意思是,如果有一个命令链:(这里|引用了我按下回车键之前的光标位置)

$ youtube-dl -f |18 --yes-playlist https://blah.blah.com    
$ x

什么命令可以x调用光标在 18 之前的命令,以便我可以超快速地编辑该数字?

答案1

我不知道有任何这样的快捷方式,但如果你只是想改变18该行中第一次出现的,你可以使用历史互动

^18^something-else

例如:

$ ls 18
ls: cannot access '18': No such file or directory
$ ^18^2003^
ls 2003
ls: cannot access '2003': No such file or directory
$ ^2003^a b^
ls a b
ls: cannot access 'a': No such file or directory
ls: cannot access 'b': No such file or directory

相关内容