방금 rpi3에 테스트된 라즈베리 파이 데비안 이미지를 설치했습니다(https://raspi.debian.net/tested-images/arm64 이미지).
ssh를 통해 루트로 시스템에 로그인하면 bash 완료가 기본적으로 작동하는 것 같습니다. 여태까지는 그런대로 잘됐다. 그러나 왜 그것이 작동하는지 이해하지 못합니다.
나는 몇 가지 전형적인 장소를 살펴보았습니다.
덜 ~/.bashrc
# ~/.bashrc: executed by bash(1) for non-login shells.
# Note: PS1 and umask are already set in /etc/profile. You should not
# need this unless you want different defaults for root.
# PS1='${debian_chroot:+($debian_chroot)}\h:\w\$ '
# umask 022
# You may uncomment the following lines if you want `ls' to be colorized:
# export LS_OPTIONS='--color=auto'
# eval "$(dircolors)"
# alias ls='ls $LS_OPTIONS'
# alias ll='ls $LS_OPTIONS -l'
# alias l='ls $LS_OPTIONS -lA'
#
# Some more alias to avoid making mistakes:
# alias rm='rm -i'
# alias cp='cp -i'
# alias mv='mv -i'
덜 ~/.profile
if [ "$BASH" ]; then\
if [ -f ~/.bashrc ]; then\
. ~/.bashrc\
fi\
fi
/etc/profile 간략히
# /etc/profile: system-wide .profile file for the Bourne shell (sh(1))
# and Bourne compatible shells (bash(1), ksh(1), ash(1), ...).
if [ "$(id -u)" -eq 0 ]; then
PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
else
PATH="/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games"
fi
export PATH
if [ "${PS1-}" ]; then
if [ "${BASH-}" ] && [ "$BASH" != "/bin/sh" ]; then
# The file bash.bashrc already sets the default PS1.
# PS1='\h:\w\$ '
if [ -f /etc/bash.bashrc ]; then
. /etc/bash.bashrc
fi
else
if [ "$(id -u)" -eq 0 ]; then
PS1='# '
else
PS1='$ '
fi
fi
fi
if [ -d /etc/profile.d ]; then
for i in /etc/profile.d/*.sh; do
if [ -r $i ]; then
. $i
fi
done
unset i
fi
/etc/bash/bash.bashrc(발췌만)
# enable bash completion in interactive shells
#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
/etc/profile.d
empty
커널 5.10.0 arm64
bash 5.1.4
질문:
- bash 완성은 어디에 구성되어 있나요?
- 이 버전의 bash에 bash-completion 패키지를 설치하는 것으로 충분합니까?