반응형
CentOS 7에서 bash 자동 완성을 사용하는 방법
bash-completion, bash-completion-extras 설치
yum install -y bash-completion bash-completion-extras
bash_completion.sh 편집
find / -name bash_completion.sh
$ find / -name bash_completion.sh
/etc/profile.d/bash_completion.sh
vim /etc/profile.d/bash_completion.sh
# Check for interactive bash and that we haven't already been sourced.
[ -z "$BASH_VERSION" -o -z "$PS1" -o -n "$BASH_COMPLETION_COMPAT_DIR" ] && return
# Check for recent enough version of bash.
bash=${BASH_VERSION%.*}; bmajor=${bash%.*}; bminor=${bash#*.}
if [ $bmajor -gt 4 ] || [ $bmajor -eq 4 -a $bminor -ge 1 ]; then
[ -r "${XDG_CONFIG_HOME:-$HOME/.config}/bash_completion" ] && \
. "${XDG_CONFIG_HOME:-$HOME/.config}/bash_completion"
if shopt -q progcomp && [ -r /usr/share/bash-completion/bash_completion ]; then
# Source completion code.
. /usr/share/bash-completion/bash_completion
fi
fi
unset bash bmajor bminor
적용
source /etc/profile.d/bash_completion.sh
자동 완성 테스트
$ yum [TAB][TAB]
check distro-sync history load-transaction remove update
check-update downgrade info makecache repolist upgrade
clean groups install provides search version
deplist help list reinstall shell
$ yum in[TAB][TAB]
info install
728x90
반응형
'리눅스' 카테고리의 다른 글
[명령어] docker system prune (0) | 2020.10.05 |
---|---|
[명령어] docker rm (0) | 2020.10.05 |
[Kubernetes] kubernetes localhost:8080 was refused 오류 (0) | 2020.10.05 |
[Kubernetes] kubernetes nginx 배포 테스트 -2 (0) | 2020.10.04 |
[Kubernetes] Kubernetes docker cgroupfs 오류 (0) | 2020.10.04 |