[Seek Help] etc/profile 内容改乱了
Tofloor
poster avatar
wpp252386997_
deepin
2021-03-20 05:28
Author

etc/profile 内容改坏了 百度 没有找到 内容 请问哪位大虾可以给我一下你们这个profile内容 呢 先谢谢了

补充 我的是 20.1版本

Reply Favorite View the author
All Replies
qq8645
deepin
2021-03-20 05:35
#1

# /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:/sbin:/usr/sbin"

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

tty | egrep -q tty[1-6] && export LC_ALL=C

Reply View the author
deepinuser17
deepin
2021-03-20 07:29
#2

不要轻易的修改系统初始设置的环境文件, /etc/profile, /etc/bash.bashrc.

 

这些环境文件对于系统稳定运行很重要. 任何定制的修改都应该放到用户个人的环境文件里, 比如, ~/.profile, ~/.bashrc, ~/.bashrc.logout.

 

 

个人的~/.profile环境比系统的/etc/profile有优先权. ~/.bashrc同样.

 

 

Reply View the author
qq8645
deepin
2021-03-20 17:49
#3
deepinuser17

不要轻易的修改系统初始设置的环境文件, /etc/profile, /etc/bash.bashrc.

 

这些环境文件对于系统稳定运行很重要. 任何定制的修改都应该放到用户个人的环境文件里, 比如, ~/.profile, ~/.bashrc, ~/.bashrc.logout.

 

 

个人的~/.profile环境比系统的/etc/profile有优先权. ~/.bashrc同样.

 

 

非常中肯的建议,折腾前至少先留个备份。

Reply View the author
wpp252386997_
deepin
2021-03-20 19:15
#4
qq8645

# /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:/sbin:/usr/sbin"

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

tty | egrep -q tty[1-6] && export LC_ALL=C

非常感谢

Reply View the author