我在Mac OSX的狮子,并以某种方式安装MySQL和Postgres我的.bash_profile上的导出PATH行得到了搞砸或删除。
所以我在这个空白的.bash_profile中添加了:
export PATH=/usr/local/bin:/usr/sbin:/usr/local/sbin:/usr/bin
但是我不能得到任何bash命令来执行:
/usr/bin $ ls -bash: ls: command not found /usr/bin $ /bin/echo $PATH /usr/local/bin:/usr/sbin:/usr/local/sbin:/usr/bin
我的.bashrc可能但不相关,但在以下情况:
[[ -s "/Users/jer/.rvm/scripts/rvm" ]] && source "/Users/jer/.rvm/scripts/rvm" function _git_prompt() { local git_status="`git status -unormal 2>&1`" if ! [[ "$git_status" =~ Not\ a\ git\ repo ]]; then if [[ "$git_status" =~ nothing\ to\ commit ]]; then local ansi=42 elif [[ "$git_status" =~ nothing\ added\ to\ commit\ but\ untracked\ files\ present ]]; then local ansi=43 else local ansi=45 fi if [[ "$git_status" =~ On\ branch\ ([^[:space:]]+) ]]; then branch=${BASH_REMATCH[1]} test "$branch" != master || branch=' ' else # Detached HEAD. (branch=HEAD is a faster alternative.) branch="(`git describe --all --contains --abbrev=4 HEAD 2> /dev/null || echo HEAD`)" fi echo -n '\[\e[0;37;' "$ansi"';1m\]'"$branch"'\[\e[0m\] ' fi } function _prompt_command() { PS1="\n `_git_prompt`"'\n \[\e[1;34m\]\w \$\[\e[0m\] ' } PROMPT_COMMAND=_prompt_command #export PS1='\n\[\033[1;33m\]\w\n\[\033[0m\]$(parse_git_branch)$ '
你丢失/bin也可能是/sbin 。
user@host ~ $ which ls /bin/ls