RHEL / CentOS Bash命令自动完成功能

默北 Linux ttlsa教程系列 Yum 原创教程 运维工具 运维案例316,7573字数 476阅读1分35秒阅读模式

黑客对linux发展贡献是非常多的。Bash命令自动完成功能只不过是收集各种黑客指定参数是如何通过Readline使用内置完成来完成的。该功能在其他linux分支是启用的,如ubuntu、debian等等。然而,基于RHCE分支发布的linux版本却没有安装和启用,如CentOS。

如果你使用过ubuntu系统,bash命令自动补齐会觉得非常方便高效。再使用RHCE或CentOS的话,你肯定会吐槽一番的,“这bash是什么鬼东西,不能自动补齐。”文章源自运维生存时间-https://www.ttlsa.com/linux/rhel-centos-bash-command-automatically-function/

那么RHEL / CentOS 怎么启用bash命令自动补齐功能呢?请看下面文章源自运维生存时间-https://www.ttlsa.com/linux/rhel-centos-bash-command-automatically-function/

1.  安装文章源自运维生存时间-https://www.ttlsa.com/linux/rhel-centos-bash-command-automatically-function/

# yum install bash-completion

需要先安装EPEL源。文章源自运维生存时间-https://www.ttlsa.com/linux/rhel-centos-bash-command-automatically-function/

2. 使用文章源自运维生存时间-https://www.ttlsa.com/linux/rhel-centos-bash-command-automatically-function/

在使用前需要注销当前session。文章源自运维生存时间-https://www.ttlsa.com/linux/rhel-centos-bash-command-automatically-function/

# logout

或者载于bash_completion文件,方法如下:文章源自运维生存时间-https://www.ttlsa.com/linux/rhel-centos-bash-command-automatically-function/

# . /etc/bash_completion
或
# source /etc/bash_completion

有兴趣的话,可以去看看这个文件。文章源自运维生存时间-https://www.ttlsa.com/linux/rhel-centos-bash-command-automatically-function/

3. 举例文章源自运维生存时间-https://www.ttlsa.com/linux/rhel-centos-bash-command-automatically-function/

bash-completion文章源自运维生存时间-https://www.ttlsa.com/linux/rhel-centos-bash-command-automatically-function/

bash-completion文章源自运维生存时间-https://www.ttlsa.com/linux/rhel-centos-bash-command-automatically-function/

转载请注明来自运维生存时间:https://www.ttlsa.com/html/4103.html文章源自运维生存时间-https://www.ttlsa.com/linux/rhel-centos-bash-command-automatically-function/ 文章源自运维生存时间-https://www.ttlsa.com/linux/rhel-centos-bash-command-automatically-function/

weinxin
我的微信
微信公众号
扫一扫关注运维生存时间公众号,获取最新技术文章~
默北
  • 本文由 发表于 25/12/2013 09:31:34
  • 转载请务必保留本文链接:https://www.ttlsa.com/linux/rhel-centos-bash-command-automatically-function/
  • bash-completion
  • bash自动补齐
  • Centos
  • EPEL
  • rhel
  • ubuntu
评论  3  访客  3
    • chenglee
      chenglee 0

      这个补全命令,直接按tab键也可以的啊~

        • 管理员
          管理员 5

          @ chenglee tab没那么全的,你试试就知道多强大了

        • zhengbin1030
          zhengbin1030 0

          正在学linux,非常有帮助的功能,谢谢分享!

        评论已关闭!