How to disable editing my history in bash

前端 未结 4 1470
独厮守ぢ
独厮守ぢ 2020-12-31 02:17

In bash, when I go back in history, edit some command and run it, this edited command is appended to history and the original one is left intact. But every once in a while I

4条回答
  •  渐次进展
    2020-12-31 03:04

    If you go back to some previous command and edit it, but then DON'T execute it (instead using history commands to go to some other command and execute it), then the edits will remain there in your history list.

    Pressing Ctrl + C, after editing, counters this behaviour. It leaves the original command in tact i.e. it cancels remembering edits to the original.

提交回复
热议问题