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

蹲街弑〆低调 提交于 2020-06-29 09:52:50

问题


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.


回答1:


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.




回答2:


Type \c and hit return. That will clear the current input statement.



来源:https://stackoverflow.com/questions/40515492/how-do-i-exit-or-cancel-inline-commands-in-the-terminal

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!