我刚刚安装了一个全新的 debian buster:
$ lsb_release -a
No LSB modules are available.
Distributor ID: Debian
Description: Debian GNU/Linux 10 (buster)
Release: 10
Codename: buster
Run Code Online (Sandbox Code Playgroud)
$ cat /etc/profile
[..]
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"
fi
export PATH
[...]
Run Code Online (Sandbox Code Playgroud)
$ whoami
zozo
$ su
Password:
# id -u
0
# printenv | grep -i ^path
PATH=/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games
Run Code Online (Sandbox Code Playgroud)
如果我以 root 身份运行:
# grep -i path /etc/profile.d/*
没有输出# grep -i path ~/.profile
没有输出# grep -i path ~/.bashrc
没有输出 …