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
3、Linux7版本
yum install bash-completion-2.1-8.el7.noarch.rpm vi /etc/bash_completion if [ -f /usr/share/bash-completion/bash_completion ]; then . /usr/share/bash-completion/bash_completion fi echo ". /etc/bash_completion" >> /etc/profile source /etc/profile
4、K8S补全
yum -y install bash-completion source /usr/share/bash-completion/bash_completion source <(kubectl completion bash) echo "source <(kubectl completion bash)" >> ~/.bashrc
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· DeepSeek 开源周回顾「GitHub 热点速览」
· 物流快递公司核心技术能力-地址解析分单基础技术分享
· .NET 10首个预览版发布:重大改进与新特性概览!
· AI与.NET技术实操系列(二):开始使用ML.NET
· 单线程的Redis速度为什么快?
2018-09-03 linux的/etc/profile环境变量设置不生效【原创】
2018-09-03 CentOS7利用systemctl添加自定义系统服务【转】