在bash命令行中,如何删除光标前的所有字母?我知道Ctrl-k会在光标后删除所有内容。
答案 0 :(得分:63)
Ctrl-u
- Cut everything before the cursor
其他Bash快捷方式,
Move cursor to beginning of line
Move cursor to end of line
Move cursor back one word
Move cursor forward one word
Cut the last word
Cut everything after the cursor
Paste the last thing to be cut
Undo
通过手册页找到更多关于bash shell的内容:man bash
其他bash命令行快捷方式备忘单:http://www.bigsmoke.us/readline/shortcuts
请参阅此处的文档:http://www.gnu.org/software/bash/manual/bashref.html#Commands-For-Killing
强制性:通过Julia的漫画了解有关Bash,Linux和Tech的更多信息:https://twitter.com/b0rk/media
答案 1 :(得分:9)
答案 2 :(得分:3)
热键Ctrl+U
应该为您完成此操作。
答案 3 :(得分:-2)
Ctrl + x退格清除光标当前位置之前的所有条目