In bash, how does one clear the current input?

前端 未结 11 2049
礼貌的吻别
礼貌的吻别 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

    Ctrl-U, Ctrl-K does the trick as well.

    Ctrl-U deletes everything from the beginning of the line up to the cursor, Ctrl-K deletes everything from the cursor to the end of the line. (It is sometimes useful to use only one of them.)

提交回复
热议问题