Debian sudo自动补全
2017-09-02 22:56
302 查看
解决 debian sudo TAB 键不能自动补全命令的原因
一般情况,命令行输入 sudo apt-get ins 按 tab ,它后面会自动补全为 install 如果右面写了包的名的一部分,按 tab 它也会自动完成或列出候选的,这次parrotOS(基于debian)突然不好使了
首先确认是否安装了 自动补全的插件,输入
apt-get install bash-completion
然后在/etc/bash.bashrc :
即 在 .bash_profile 里加
if [ -f /etc/bash_completion ]; then
. /etc/bash_completion
fi
就 ok 了
链接:http://gumelta.com/add-bash-completion-in-debian.php
完整 copy 下来吧:
Add Bash Completion In Debian
ash completion is a useful tool for completion of file paths, commands etc. By default it is enabled on Ubuntu but not on Debian. With two simple steps it can also be enabled on Debian.
Install bash-completion
First of all we need the install the according package:
apt-get install bash-completion
Add it to the bash profile
Either edit the ~/.bash_profile file to enable it only for a given user or edit /etc/profile to add it system-wide. Add the following code:
if [ -f /etc/bash_completion ]; then
. /etc/bash_completion
fi
Try it
In order for it to work you have to log out and relogin and then you can make use of bash completion the usual way. E.g. issue:
apt-g
and then press the TAB key once and the command will be completed to apt-get. Or issue this:
apt
and then press TAB key twice. You can also try with
apt-get install apa
and then press TAB key once to complete as far as possible and a second time to list all options.
一般情况,命令行输入 sudo apt-get ins 按 tab ,它后面会自动补全为 install 如果右面写了包的名的一部分,按 tab 它也会自动完成或列出候选的,这次parrotOS(基于debian)突然不好使了
首先确认是否安装了 自动补全的插件,输入
apt-get install bash-completion
然后在/etc/bash.bashrc :
即 在 .bash_profile 里加
if [ -f /etc/bash_completion ]; then
. /etc/bash_completion
fi
就 ok 了
链接:http://gumelta.com/add-bash-completion-in-debian.php
完整 copy 下来吧:
Add Bash Completion In Debian
ash completion is a useful tool for completion of file paths, commands etc. By default it is enabled on Ubuntu but not on Debian. With two simple steps it can also be enabled on Debian.
Install bash-completion
First of all we need the install the according package:
apt-get install bash-completion
Add it to the bash profile
Either edit the ~/.bash_profile file to enable it only for a given user or edit /etc/profile to add it system-wide. Add the following code:
if [ -f /etc/bash_completion ]; then
. /etc/bash_completion
fi
Try it
In order for it to work you have to log out and relogin and then you can make use of bash completion the usual way. E.g. issue:
apt-g
and then press the TAB key once and the command will be completed to apt-get. Or issue this:
apt
and then press TAB key twice. You can also try with
apt-get install apa
and then press TAB key once to complete as far as possible and a second time to list all options.
相关文章推荐
- sudo: fastboot: command not found ,fastboot自动补全,adb自动补全
- debian下增强bash的自动补全功能
- Debian 8 Tab命令无法自动补全
- Linux sudo自动补全
- debian中配置c#语法高亮的vim编辑器,并使用YouCompleteMe自动补全
- Linux下解决sudo输入命令不能自动补全
- 修补sudo的自动补全
- Linux下解决sudo输入命令不能自动补全
- sudo和man的tab自动补全
- Debian squeeze安装vim自动补全插件snipMate.绝对可用
- 解决 debian TAB 键不能自动补全命令的原因
- iOS开发中导入第三方库时不能自动补全头文件的解决方法
- QT Creator 代码自动补全
- Eclipse增强自动补全
- a标签href动态取值,自动补全问题
- js input框自动补全
- vim 自动补全括号、引号等
- jquery 自动补全插件autocomplete
- 用原生HTML5控件实现输入框自动提示(下拉列表补全)功能
- CentOS6.5(2)----安装Tab键自动补全功能:bash-completion