在.bashrc文件的末尾,我添加了以下几行以设置主目录中foo
文件夹的路径:
PATH = $PATH:/home/username/foo
export PATH;
然后我输入bash:
source .bashrc
这些产生的错误:
bash: PATH: command not found
我正在使用Debian Squeeze。在类似的问题here中,建议修改/etc/login.defs。我不想这样做,就像在login.defs中这样写:
add the rest [of your paths] in the shell startup files
如何将文件夹
foo
添加到.bashrc中的PATH? 最佳答案
您使用了错误的语法。删除空格:
export PATH=$PATH:/home/username/foo
关于
/etc/login.defs
或任何其他全局配置:嗯,这是全局配置,因此在$HOME
目录中添加路径可能不是一个好主意。 ;)