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

后端 未结 10 1145
伪装坚强ぢ
伪装坚强ぢ 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:23

    You can also put

    shopt -s histverify
    

    in your .bash_profile, which causes any history expansion to appear on your command line without running it, allowing you to edit before doing so.

提交回复
热议问题