Mac 终端 ls等命令失效问题

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/AliceGoToAnother/article/details/79171192

原因: 环境变量设置错误
Solution:

1、命令行中输入以下命令,确保命令暂时可以使用,命令行执行完不要关闭终端;

export PATH=/usr/bin:/usr/sbin:/bin:/sbin:/usr/X11R6/bin

2、修改.bash_profile文件
终端输入vi ~/.bash_profile 打开文件,将内容修改为以下形式,根据自己情况相应修改

export PATH="/$HOME/mongodb/bin:$PATH"
export PATH="/usr/local/homebrew/bin:$PATH"

3、使修改生效

source ~/.bash_profile

猜你喜欢

转载自blog.csdn.net/AliceGoToAnother/article/details/79171192
今日推荐