在bash中,一个人如何清除当前输入? [英] In bash, how does one clear the current input?
问题描述
假设你开始编写像这样的命令的bash:
$ RM -rf /富/酒吧/真的/长/路径/这里
,然后意识到你不想毕竟执行此。有没有办法清除输入一个或两个按键?
我一直在做最近为prepending回声和封闭在引号输入(按Ctrl + A,回声
,按Ctrl + E,),然后按下回车键。是否有一个更快的方法?
-
preSS <大骨节病>控制骨节病> - <大骨节病> U 骨节病>删除光标之前的一切。被删除的命令将被存储到缓冲区中。 preSS <大骨节病>控制骨节病> - <大骨节病>是骨节病>粘贴删除命令
(可选:preSS <大骨节病>结束骨节病>或<大骨节病>控制骨节病> - <大骨节病>电子骨节病>跳转到输入的结束首)
-
另外,preSS <大骨节病>控制骨节病> - <大骨节病> C 骨节病>中止你正在输入的内容
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 after all. Is there a way to clear the input with one or two keystrokes?
What I have been doing lately is prepending echo and enclosing the input in quotes (Ctrl+A, echo "
, Ctrl+E, "
) then hitting enter. Is there a faster way?
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.)
Alternatively, press Ctrl-C to abort what you're typing.
这篇关于在bash中,一个人如何清除当前输入?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!