PATH 环境变量的定义涉及从哪些文件和步骤?

sh/bash/dash/ksh/zsh等Shell脚本
回复
头像
jiyinyiyong
帖子: 631
注册时间: 2010-01-03 19:58
系统: OS X, Ubuntu(server)
来自: 杭州
联系:

PATH 环境变量的定义涉及从哪些文件和步骤?

#1

帖子 jiyinyiyong » 2012-11-21 19:54

同学遇到 CentOS 上 PATH 出错的问题.. 各种 "command not found"... 神奇的 cd 居然还能用...
没找到 history 里编辑过的可疑命令, 也没法排查..
我在 Arch 里有看到 /etc/profile 里声明了 PATH, 但 Ubuntu 和 CentOS 上没看到这个,,,
除了 /etc/profile 和 ~/.bashrc, ~/.bash_profile 以外, 还有哪些文件涉及到了 PATH 的定义
头像
枫叶饭团
帖子: 14683
注册时间: 2010-06-16 1:05
系统: Mac OS X
来自: Tencent
联系:

Re: PATH 环境变量的定义涉及从哪些文件和步骤?

#2

帖子 枫叶饭团 » 2012-11-21 20:33

cd是内置命令当然能用。/etc/profile.d?
zhangxiaofir
帖子: 53
注册时间: 2010-12-09 23:54

Re: PATH 环境变量的定义涉及从哪些文件和步骤?

#3

帖子 zhangxiaofir » 2012-11-22 18:42

BASH_BUILTINS(1) BASH_BUILTINS(1)

NAME
bash, :, ., [, alias, bg, bind, break, builtin, caller, cd, command,
compgen, complete, compopt, continue, declare, dirs, disown, echo,
enable, eval, exec, exit, export, false, fc, fg, getopts, hash, help,
history, jobs, kill, let, local, logout, mapfile, popd, printf, pushd,
pwd, read, readonly, return, set, shift, shopt, source, suspend, test,
times, trap, true, type, typeset, ulimit, umask, unalias, unset, wait -
bash built-in commands, see bash(1)
回复