bash 你在ctrl+u中代表什么?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/4415598/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
what does u stand for in ctrl+u?
提问by draw
I was trying to understand and remember keyboard shortcuts for bash. I was wondering why is the char 'u' used in
我试图理解并记住 bash 的键盘快捷键。我想知道为什么字符 'u' 用于
CTRL-u --- cancel the line before cursor location
回答by Ned Deily
While unix-line-discardis a good mnemonic, the use of CTRL+Uas a line-erase character precedes the invention of UNIX. It was used as such on various Digital Equipment (DEC) systems, including the PDP-8. For instance, from my dusty bookshelf I see that CTRL+Uwas used as line-erase in the PDP-8 Symbolic Editor (page 5-13 of the 1972 edition of the PDP-8 Introduction To Programming (Volume 1)manual published by DEC). In fact, in the early days of UNIX, the @character was often the default line-erase character. Other systems used CTRL+Xfor the same function, which made some sense since the ASCII control character description for it is Cancel. The DEC convention of CTRL+Ueventually won out in the popularity contest.
虽然unix-line-discard是一个很好的助记符,但在 UNIX 发明之前使用CTRL+U作为行擦除字符。它被用于各种数字设备 (DEC) 系统,包括 PDP-8。例如,从我尘土飞扬的书架上,我看到CTRL+U在 PDP-8 符号编辑器(PDP-8 Introduction To Programming (Volume 1)DEC 出版的手册1972 年版的第 5-13 页)中用作行擦除。事实上,在 UNIX 的早期,该@字符通常是默认的行擦除字符。其他系统将CTRL+X用于相同的功能,这是有道理的,因为它的 ASCII 控制字符描述是Cancel. CTRL+的DEC约定U最终在人气竞赛中获胜。
回答by Adam Vandenberg
"unix-line-discard": http://cnswww.cns.cwru.edu/php/chet/readline/readline.html#SEC17
“unix-line-discard”:http: //cnswww.cns.cwru.edu/php/chet/readline/readline.html#SEC17

