In bash, how does one clear the current input?

前端 未结 11 2025
礼貌的吻别
礼貌的吻别 2020-12-04 05:56

Suppose in bash you start writing a command like:

$ rm -rf /foo/bar/really/long/path/here

and then realize you don\'t want to execute this

11条回答
  •  温柔的废话
    2020-12-04 06:15

    A nice shortcut is pressing Esc#. It will prepend a # character (thus making the line a comment) and then press enter. If you then decide that you still the need the command, you still have it in your history :)

提交回复
热议问题