Linux命令补全工具bash-completion

  • A+
所属分类:资源分享

软件介绍

在使用bash命令行时,在提示符下输入某个命令的前面几个字符,然后按下TAB键,就会列出以这几个字符开头的命令供我们选择。

不光如此,还能进行参数补全,但只限于文件参数,当输入参数部分时,按下TAB键,就会列出以这个参数开头的文件路径供我们来选择。

Bash提供一个complete内建命令,它的用途是规定参数怎么自动的补全。它怎么使用的在网上的资料都没怎么看见,man手册页不太想看,但是这个世界好人真的挺多,网络上提供了一个称之为bash-completion的软件包,通过一个复杂的脚本bash_completion实现可编程的补全程序,减少系统管理日常维护工作,减少差错,提高工作效率。

下载地址

此处为隐藏的内容!
登录后方可查看!

安装步骤

  1. unzip bash-completion.zip
  2. #解压文件
  3. cd 2018012716190557
  4. #进入目录
  5. mv bash-completion-master /usr/share/bash-completion
  6. #移动目录
  7. vi ~/.bashrc
  8. #编辑文件,在末尾处添加如下内容:
  9. [[ $PS1 && -f /usr/share/bash-completion/bash_completion ]] && \
  10.     . /usr/share/bash-completion/bash_completion

使用方法

  1. 安装后需注销当前用户,重新登录生效;
  2. 使用时tab可补全命令的参数。
  • 问答中心
  • 微信小程序扫一扫
  • weinxin
  • 微信公众
  • 微信公众号扫一扫
  • weinxin

发表评论

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

目前评论:35   其中:访客  35   博主  0

    • avatar holiday weather

      I truly love your website.. Pleasant colors & theme. Did you make this amazing site yourself? Please reply back as I’m planning to create my own personal blog and would love to find out where you got this from or what the theme is called. Kudos!

      • avatar Digital Marketing Course

        Leading Digital Marketing agency in India and Kolkata, Leading Web Design company. Providing web designing and Digital marketing services, Digital marketing course, and certification with an internship.

        • avatar Investments

          You’ve made some good points there. I looked on the net to find out more about the issue and found most individuals will go along with your views on this web site.

          • avatar Online Pharmacy

            Leading Online Pharmacy – Contact us at +1 (917) 259-3352 for unbelievable rates, discount and offers on any medicine. Get it delivered free of cost at your door steps, call us today. Phone : +1 (917) 259-3352

            • I enjoy reading through an article that can make men and women think. Also, thank you for allowing me to comment!