In bash, how does one clear the current input?

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

    There are two options to do this

    ctrl+c - this clears the whole line, no matter where the cursor is.

    ctrl+u - this clear the line from the position of the cursor until the beginning.

提交回复
热议问题