Jalena Blog

  • 首页
  • 程序开发
    • Java
    • Spring
    • SpringBoot
    • SpringMvc
    • Python
    • Odoo
    • C#
    • SQL
    • Web
    • Linux
  • 移动设备
    • Android
    • Router
  • 杂七杂八
    • 我的废话
    • 音频
    • 视频
    • 常用软件
  • 关于
  1. 首页
  2. 软件开发
  3. Linux
  4. 正文

Centos/Mac 命令自动补全

2019-08-30

常常使用tab来补全需要的命令参数,但在最小化安装系统的时候默认不安装,由于软件在epel库中,安装时先安装epel-release,再安装bash-completion,且需要重新建立bash环境。

yum -y install epel-release
yum -y install bash-completion
# or Debian
apt-get install bash-completion -y
brew install bash-completion

# 写入设置,具体的可以通过 brew info bash-completion 查看
vim ~/.zshrc
fpath=(/usr/local/share/zsh-completions $fpath)
plugins=(... zsh-completions)
autoload -U compinit && compinit

Docker

curl https://raw.githubusercontent.com/docker/docker-ce/master/components/cli/contrib/completion/bash/docker -o /etc/bash_completion.d/docker.sh

# 激活,在.bashrc中添加如下配置

# enable programmable completion features (you don't need to enable
# this, if it's already enabled in /etc/bash.bashrc and /etc/profile
# sources /etc/bash.bashrc).
if ! shopt -oq posix; then
  if [ -f /usr/share/bash-completion/bash_completion ]; then
    . /usr/share/bash-completion/bash_completion
  elif [ -f /etc/bash_completion ]; then
    . /etc/bash_completion
  fi
fi
标签: Centos
最后更新:2023-12-08

Jalena

原创内容,转载请注明出处! 部分内容来自网络,请遵守法律适用!

点赞
< 上一篇
下一篇 >

文章评论

  • repostone

    非技术的路过。

    2019-08-30
    回复
  • razz evil exclaim smile redface biggrin eek confused idea lol mad twisted rolleyes wink cool arrow neutral cry mrgreen drooling persevering
    取消回复

    【腾讯云】云服务器特惠热卖中
    文章目录
    • Docker
    标签聚合
    java Centos odoo 其他 生活 wordpress docker MySql
    分类
    • Android / 4篇
    • C# / 10篇
    • Codec / 9篇
    • Conversion / 14篇
    • Editing / 16篇
    • Java / 47篇
    • Javascript / 3篇
    • Linux / 30篇
    • Odoo / 25篇
    • Python / 6篇
    • SQL / 30篇
    • Web / 3篇
    • Windows / 4篇
    • 我的日记 / 10篇
    • 杂七杂八 / 93篇
    • 软件开发 / 72篇
    • 非线性编辑 / 1篇

    COPYRIGHT © 2026 Jalena Blog. ALL RIGHTS RESERVED.

    Theme Kratos Made By Seaton Jiang

    蜀ICP备17025376号