C0reFast / c0refast.github.io

1 stars 0 forks source link

在Bash,Zsh中快速输入sudo | C0reFast记事本 #69

Open C0reFast opened 2 years ago

C0reFast commented 2 years ago

https://www.ichenfu.com/2017/03/29/bash-zsh-fast-sudo/

在使用普通用户执行需要超级用户权限的指令时,经常忘记前面加上sudo,等到命令输入完成,再加sudo很麻烦,可以绑定一个快捷方式快速输入最前面的sudo:如果使用Bash,在~/.bashrc中加入: bind '"\e\e":"\C-asudo \C-e"' 如果使用Zsh,在~/.zshrc中加入: bindkey -s '\e\e' '\C-asudo \C-e' 生效后,只需要连续按两下E