Bash는 모든 프롬프트 전에 내 별칭 중 하나만 인쇄합니다.

Bash는 모든 프롬프트 전에 내 별칭 중 하나만 인쇄합니다.

~/.bashrc나는 이것이 내 파일 의 관련 부분이라고 생각합니다 .

# enable color support of ls and also add handy aliases
if [ -x /usr/bin/dircolors ]; then
    test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dircolors -b)"
    alias ls='ls --color=auto'
    #alias dir='dir --color=auto'
    #alias vdir='vdir --color=auto'

    alias grep='grep --color=auto'
    alias fgrep='fgrep --color=auto'
    alias egrep='egrep --color=auto'
fi

(이 내용을 어디서 얻었는지 잊어버렸기 때문에 슬프게도 출처를 밝힐 수 없습니다.) 이 줄은 파일 alias ls='ls --color=auto'에서 나타나는 유일한 모습입니다 ~/.bashrc.

성가신 점은 프롬프트/터미널/bash를 열 때마다 터미널이 에코된다는 것입니다.

alias ls='ls --color=auto'

(다른 사람들은 그렇지 않습니다!) 이 알림을 제거하고 싶습니다.

편집하다:profile시스템에서 찾을 수 있는 다른 파일은 다음과 같습니다 .

#~/.bash_profile
#!/bin/bash
echo "You've got rhythm. You've got music. Anything else?"


#~/.profile
#unmask 022
if [ -n "$BASH_VERSION" ]; then
    if [ -f "$HOME/.bashrc" ]; then
        . "$HOME/.bashrc"
    fi
fi

if [ -d "$HOME/bin" ] ; then
    PATH="$HOME/bin:$PATH"
fi



#/etc/profile
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

답변1

관련 정보