How do I exit or cancel inline commands in the terminal?

后端 未结 2 1736
时光取名叫无心
时光取名叫无心 2021-01-17 04:56

If I\'m in the Terminal and I want to exit or cancel a command how would I do so? Escape does nothing and hitting the up arrow copies the command.

2条回答
  •  旧巷少年郎
    2021-01-17 05:46

    Ctrl + C is used to kill a process with the signal SIGINT, and can be intercepted by a program so it can clean its self up before exiting, or not exit at all.

    Ctrl + Z is used for suspending a process by sending it the signal SIGSTOP, which cannot be intercepted by the program.

    Random fact:

    If you were writing a long command such as $ cd /User/myname/Desktop -r grep | .*.* and want to delete it press Ctrl + U.

提交回复
热议问题