小编tec*_*ack的帖子

在 /etc/profile 中调整 $PATH 不会影响 root

PATH在 in 中添加了一个目录/etc/profile。这适用于我的用户帐户,但不适用于 root。将它添加到我的很容易,/root/.bashrc但我想了解有什么问题。这是一个大部分未修改的 Debian 6,所以我认为我的更改应该可以解决问题。

这是我的/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/lib/distcc/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
else
  PATH="/usr/lib/distcc/bin:/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games"
fi
export PATH

if [ "$PS1" ]; then
  if [ "$BASH" ]; then
    # The file bash.bashrc already sets the default PS1.
    # PS1='\h:\w\$ '
    if [ -f /etc/bash.bashrc ]; then
      . /etc/bash.bashrc
    fi
  else …
Run Code Online (Sandbox Code Playgroud)

linux root bash path

11
推荐指数
1
解决办法
8602
查看次数

标签 统计

bash ×1

linux ×1

path ×1

root ×1