歡迎來到Linux教程網
Linux教程網
Linux教程網
Linux教程網
Linux教程網 >> Linux基礎 >> Linux技術 >> Linux開機後終端提示-bash-2.05b$怎麼辦?

Linux開機後終端提示-bash-2.05b$怎麼辦?

日期:2017/3/2 11:43:00   编辑:Linux技術

  Linux系統操作中,開機後終端界面提示-bash-2.05b$ ,導致終端無法彩色顯示,遇到這個問題應該如何處理呢?下面小編就給大家介紹下Linux終端提示-bash-2.05b$ 的解決方法,希望對你有所幫助。

 Linux開機後終端提示-bash-2.05b$怎麼辦?

  Linux第一次使用時終端的顯示界面面現:

  onejet20080605 (root) ~ $ 《顯示正常》

  下次開機後終端顯示:

  -bash-2.05b$ 《顯示不正常》

  而且終端的彩色的顯示也沒了。

  解決方法:

  一、首先確認你的root目錄下(如果你用的是root用戶登錄的話)有下面這兩個文件:

  1、/root/.bashrc

  2、/root/.bash_profile

  注意這兩個文件是隱藏文件來的。

  二、如果沒有,那就創建這兩個文件,並在這兩個文件中加入以下內容:

  /root/.bashrc內容:

  # .bashrc

  # User specific aliases and functions

  # Source global definitions

  if [ -f /etc/bashrc ]; then

  。 /etc/bashrc

  fi

  /root/.bash_profile內容:

  # .bash_profile

  # Get the aliases and functions

  if [ -f ~/.bashrc ]; then

  。 ~/.bashrc

  fi

  # User specific environment and startup programs

  export BASH_ENV=$HOME/.bashrc

  三、由上面的兩個腳本看,還跟/etc/bashrc這個文件有關,如果沒有,那也創建,其內容如下:

  /etc/bashrc內容:

  # /etc/bashrc

  # System wide functions and aliases

  # Environment stuff goes in /etc/profile

  # Uncomment if you liked the old colourfull prompt

  # PS1=‘\[\033[1;33m\]\u\[\033[1;37m\]@\[\033[1;32m\]\h\[\033[1;31m\]\w\[\033[1;36m\]\$ \[\033[0m\]’

  PS1=‘\[\033[0;34m\]\h (\[\033[0;31m\]\u\[\033[0;34m\]) \[\033[0;32m\]\w $ \[\033[0m\]’

  VIM=“/usr/share/vim”

  alias ls=‘ls --color=tty -F -b -T 0’

  經過上面的三步一般都會成功的,你只要重開一個終端就可以看出效果了。當然這還跟/etc/hosts, /etc/passwd等文件相關,但一般就是上面的哪個文件沒有或出錯了的。

  上面就是Linux終端出現-bash-2.05b$ 的解決方法介紹了,出現這種問題可能和/root/.bashrc、/root/.bash_profile和/etc/bashrc文件的丟失有關,重新創建即可。

Copyright © Linux教程網 All Rights Reserved