昨天配Mongodb是终端手动打的export PATH=xxxxx,但还是想找一个一劳永逸的方法。过程中颇多纠结,这里小记一笔吧。
mac下登入终端后直接进入Users/yourUserName 目录,在这里直接 ls - al 找.bashrc文件或者.base_profile文件。然并卵,没找到。touch .base_profile && vim .base_profile 后加入配置全局路径的那一行代码(我的是export PATH=/Users/gege/playground/mongodb/bin:$PATH),然后重启终端,执行Mongo, 命令未找到。同样的方法尝试新建 && 改bashrc文件也没用。但旁边的小姐姐说她的MAC PRO这么做可以,那我就不知道了。可能电脑上的一些配置啊命令啊不一样吧。
.bash_profile is executed for login shells, while .bashrc is executed for interactive non-login shells.
When you login (type username and password) via console, either sitting at the machine, or remotely via ssh: .bash_profile is executed to configure your shell before the initial command prompt.
But, if you’ve already logged into your machine an