将原先的bash_profile中的PATH环境变量中的$PATH删除了,然后执行source ~/.bash_profile之后就出现了错误,每次打开Terminal都显示: -bash: grep: command not found -bash: grep: command not found env: bash: No such file or directory env: bash: No such file or directory env: bash: No such file or directory env: bash: No such file or directory env: bash: No such file or directory -bash: grep: command not found -bash: cat: command not found -bash: grep: command not found -bash: grep: command not found -bash: grep: command not found -bash: grep: command not found 所有的命令都不能正常执行了,类似:top、ifconfig 都会显示:-bash: top: command not found
还请大家帮忙看看怎样恢复???
确定你的编辑器的目录位置,比如为/usr/bin/vim, 然后输入命令时用全路径: /usr/bin/vim ~/.bash_profile 打开上面的文件后,至少加上
PATH=/bin:/sbin/ export PATH
估计这样就可以恢复原来的样子了
欢迎来到随意问技术百科, 这是一个面向专业开发者的IT问答网站,提供途径助开发者查找IT技术方案,解决程序bug和网站运维难题等。 温馨提示:本网站禁止用户发布与IT技术无关的、粗浅的、毫无意义的或者违法国家法规的等不合理内容,谢谢支持。