ubuntu如何实现自动补齐

ubuntu如何实现自动补齐

ubuntu实现自动补齐的方法:

1.以root权限利用vi编辑器打开/etc/bash.bashrc文件,命令:

sudo vi /etc/bash.bashrc

2.找到/etc/bash.bashrc文件中的下列代码进行修改。

#enable bash completion in interactive shells

# if ! shopt -oq posix; then

# if [ -f /usr/share/bash-completion/bash_completion ]; then

# . /usr/share/bash-completion/bash_completion

# elif [ -f /etc/bash_completion ]; then

# . /etc/bash_completion

# fi

# fi

需要去掉去掉 if 到 fi 之间的注释 # 号,例如:

#enable bash completion in interactive shells

if ! shopt -oq posix; then

if [ -f /usr/share/bash-completion/bash_completion ]; then

. /usr/share/bash-completion/bash_completion

elif [ -f /etc/bash_completion ]; then

. /etc/bash_completion

fi

fi

3.最后刷新保存一下即可,命令:

source /etc/bash.bashrc 

相关文章

ubuntu退出redis的示例:指定配置文件方式启动源码redis:roo...
ubuntu中mysql改密码忘了的解决方法:1.在终端中切换到root权...
ubuntu安装mysql失败的解决方法原因:可能是原有的MySQL还有...
使用centos和ubuntu建站的区别有以下几点1.CentOS是Linux发行...
ubuntu图形界面和字符界面切换的方法:可以通过快捷键CTRL+A...
ubuntu中重启mysql失败的解决方法1.首先,在ubuntu命令行中,...