取消删除在bash删除命令 [英] undelete the deleted command in bash

查看:92
本文介绍了取消删除在bash删除命令的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果你写了一个很长的命令,说 CD /非常/长/路径,然后你做的Ctrl + C或Ctrl + U键(如果游标在结束),然后你意识到你想要的命令后面,有没有什么办法让全线回,而无需重新输入。有没有什么绝招来改变的.bashrc 的.bash_history 跟踪键pressed在外壳上,而不是刚过进入被击中。

If you have written a really long command, say cd /very/long/path, and then you do ctrl+c or ctrl+u (if the cursor is at the end), and then you realise that you want the command back, is there any way to get the full line back without re-typing. Is there any trick to change .bashrc so that bash_history keep track of keys pressed on the shell and not just after the enter is hit.

我已经回答了在<一个问题href=\"http://stackoverflow.com/questions/1056394/in-bash-how-does-one-clear-the-current-input\">http://stackoverflow.com/questions/1056394/in-bash-how-does-one-clear-the-current-input并意识到如果我们有一些像这样的选项,这将是非常有益的。

I have answered a question at http://stackoverflow.com/questions/1056394/in-bash-how-does-one-clear-the-current-input and realised if we have some option like this it would be very helpful.

推荐答案

要撤消,请使用


  • <大骨节病>控制 + <大骨节病> X ,<大骨节病>控制 + <大骨节病> U ;或

  • <大骨节病>控制 + <大骨节病> _ (下划线)。

  • Ctrl+X, Ctrl+U; or
  • Ctrl+_ (underscore).

请参阅绑定-P 为键绑定的庆典的完整列表。

See bind -P for a full list of keybindings in bash.

这篇关于取消删除在bash删除命令的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆