我不想访问shell中的shell命令历史记录。它必须暂时封锁,然后我才能释放那个封锁。你知道吗
例如,当我在shell中按up arrow
时,它会显示历史中出现的最后一个命令,但当我在shell上按向上箭头时,我不想访问历史
我们能阻止历史访问它吗?你知道吗
我试过set +o history
,但目的不同。你知道吗
shell:> ifconfig
shell:> #some shell.py
Login: #when I press up arrow, "ifconfig" comes here as that was last command
Password:
对于登录:它只需要访问输入,不在此处访问历史记录。 接受登录和密码后,我可以再次访问历史记录。你知道吗
删除向上箭头绑定
恢复
检索到
previous-history
的所有绑定或者
另请参见
您可以通过编辑
~/.bashrc
并添加以下内容来禁用向上箭头键:bind '"\e[A": '
意思是:绑定
Up Arrow Key
为空(需要重新加载或重新打开会话)
要重新启用它,只需删除该行并重新加载
.bashrc
文件相关问题 更多 >
编程相关推荐