Using bash history to get a previous command, copy it and then 'run' it but with the command commented

后端 未结 10 1033
伪装坚强ぢ
伪装坚强ぢ 2021-01-29 20:34

Just a question to improve my bash skills. I always do this:

$ history | grep some_long_command

...
...
123 some_long_command1.........
124 some_l         


        
10条回答
  •  说谎
    说谎 (楼主)
    2021-01-29 21:11

    You may wan to try "suggest box"-like history https://github.com/dvorka/hstr - it reads Bash history and allows for quick navigation.

    hh

    To get the last command simply type hh, navigate to the command and use right arrow to get it on command line (where you can edit it and/or add comment).

提交回复
热议问题