In bash, how does one clear the current input?

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

    1. Press Ctrl-U to delete everything before the cursor. The deleted command will be stored into a buffer. Press Ctrl-Y to paste the deleted command.

      (Optional: Press End or Ctrl-E to jump to the end of the input first.)

    2. Alternatively, press Ctrl-C to abort what you're typing.

提交回复
热议问题