linux使用bash-completion補全【原創】


1、安裝

yum install bash-completion-1.3-7.el6.noarch.rpm

 

2、設置

重新登錄看是否生效,service + Tab看是否生效

# service 
auditd           daytime-dgram    halt             lvm2-monitor     nginx            rpcidmapd        snmptrapd        winbind
avahi-daemon     daytime-stream   hp-asrd          mdmonitor        nmb              rpcsvcgssd       sshd             wpa_supplicant
bluetooth        discard-dgram    hp-health        messagebus       ntpd             rsync            sysstat          xinetd
cgconfig         discard-stream   hpsmhd           netbackup        ntpdate          rsyslog          tcpmux-server    zabbix_agentd
cgred            dnsmasq          httpd            netconsole       postfix          salt-minion      telnet           
chargen-dgram    ds_agent         ip6tables        netfs            rdisc            sandbox          telnet.bak       
chargen-stream   echo-dgram       iptables         network          restorecond      saslauthd        time-dgram       
chronyd          echo-stream      jexec            NetworkManager   rhnsd            single           time-stream      
crond            firstboot        killall          nfs              rpcbind          smb              udev-post        
cvs              haldaemon        lm_sensors       nfslock          rpcgssd          snmpd            vxpbx_exchanged 

如果不生效可以使用以下方法

1)在用戶家目錄下

vi ~/.bashrc
. /etc/bash_completion

2)全局用戶生效

echo ". /etc/bash_completion" >> /etc/profile

 

echo ". /etc/bash_completion" >> /etc/profile


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM