The Centos 6.6 command line implements auto-completion

Source: Internet
Author: User

Company colleagues with the Ubuntu system, automatic completion of the function is good, but my CentOS 6.6 system using sudo can not be automatically complete, git command can not be automatically complete.

Search online for a workaround as follows.

A git can't fill the whole problem

Download git source code

$ git clone https://www.kernel.org/pub/scm/git/
Locate the Git-completion.bash file and copy it to the ~/directory

$ sudo cp contrib/completion/git-completion.bash ~/.git-completion.bash
Edit/ETC/BASHRC file Last added: Source/home/yourname/.git-completion.bash

Or

$ sudo cp contrib/completion/git-completion.bash/etc/bash_completion.d/
Source/etc/bash_completion.d/git-completion.bash

Another way to get Git-completion.bash:

sudo find/-name ' git-completion* '/usr/share/doc/git-1.7.1/contrib/completion/git-completion.bash
So there is a file in the Linux system, the direct copy can be.


Two automatic completion. This is said to complete, not just the system default completion path with the file name of the complement function, but the command parameters of the completion, with this completion, in the bash can almost complete any complement of complete.

Redhat system is not installed by default, you need to install a bash-completion, it can be implemented. When you sudo yum install xxx, any one of these words you complete, enter the Yum ins and then press the TAB key to complete the install.

Before installing, execute LS in the/etc/bash_completion.d/directory:

git                          rpmlintcreaterepo.bash           gvfs-bash-completion.sh      scl.bashdbus-bash-completion.sh   perf                         subversiondkms                      pk-completion.bash           yum.bashgdbus-bash-completion.sh  rpmdevtools.bash-completion  Yum-utils.bash

Installation:
sudo yum install bash-completion

In the view/etc/bash_completion.d/file below:

Ant gvfs-bash-completion.sh rcsautoconf gzip Redefine_filedira Utomake iconv rfkillbash-builtins Ifupdown rpcdebugbind-ut Ils info rpmbrctl iproute2 rpmdevtools.bash-complet Ionbumblebee iptables rpmlintbzip2 Java RSYNCCHKCO                 Nfig lsof sambaconfigure LVM scl.bashcoreutils                      Lzma servicecpan2dist make Shcpio Man Shadowcreaterepo.bash mdadm Smartctlcrontab min               Icom sqlite3cryptsetup module-init-tools sshcups mysqladmin   Stracecvs                    Net-tools subversiondbus-bash-completion.sh Nmap Tardd                      Ntpdate tcpdumpdhclient OPEN-ISCSI util-linuxdkms                 OpenSSL Wireless-toolsdvd+rw-tools perf Wodime2fsprogs                      Perl wvdialfindutils Pk-completion.bash Xmllintfuse                       Pkg-config XMLWFGCC pm-utils Xorg-x11-server-utilsgdb Postfix xsltprocgdbus-bash-completion.sh PostgreSQL xzgenisoimage PR                    OCPs yp-toolsgetent python yum.bashgit qdbus YUM-UTILS.BASHGPG2 Quota-tools

This is the time to complete the auto-completion function.




The Centos 6.6 command line implements auto-completion

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.