터미널은 열릴 때 이것을 보여줍니다 :
bash: /home/atlas/.bashrc: line 73: syntax error near unexpected token `['
bash: /home/atlas/.bashrc: line 73: `if [ -x /usr/bin/dircolors ] ; then '
다음을 사용하여 문제를 해결하려고했습니다.
cp /ect/skel/.bashrc ~/
그리고 나는 이것을 얻는다 :
cp: cannot stat `/ect/skel/.bashrc': No such file or directory
왜 이것이 이것을하고 있고 어떻게 고치는 지 확신 할 수 없습니다. 나는 이전에 .bashrc
파일을 엉망으로 만들었고 분명히 무언가를 엉망으로 만들었습니다. 내가하고 싶은 것은 .bashrc
파일을 기본 설정 으로 복원하는 것 입니다.
답변
경로가 잘못되었다고 생각합니다 . etc
그렇지 않습니다 ect
.
우분투 에는 디렉토리에 파일 의 기본 버전 이 있으므로 문제가 있으면 복원 할 수 있습니다. .bashrc
/etc/skel/
그렇게하려면 다음 단계를 따르십시오.
-
현재
.bashrc
파일을 백업하십시오 .cp ~/.bashrc ~/.bashrc.bak
-
스켈레톤
.bashrc
파일을 복사 하십시오.cp /etc/skel/.bashrc ~/
-
그런 다음 새 것을로드하십시오.
source ~/.bashrc
답변
https://gist.github.com/marioBonales/1637696/raw/337f7b60d4e3d9e887a0206dec6a737e94cdd26e/.bashrc 의 내용을 복사 하십시오.
에 ~/.bashrc
. 이와 같은 텍스트 편집기를 사용할 수 있습니다 gedit
.
답변
반드시 다시 만들 필요는 없으며 오류 메시지가 무엇을 나타내는 지 살펴보십시오. 파일에 구문 오류가 있다고 말합니다. 당신이 가진 것으로, 나는 그것이 핵심 장소에서 잘못되었다고 말하고 싶습니다.
대신에
if [ -x /usr/bin/dircolors ] ; then
그것은해야한다
if [ -x /usr/bin/dircolors ]; then
]
와 사이에 공간이 부족 합니다 ;
.
또한 참고로 여기에 전체 if 블록이 있습니다.
# 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 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