我想知道我应该将这个 bash 命令放在哪个文件中,以便它在启动时运行。
# Start the MongoDB server
/Applications/MongoDB/bin/mongod --dbpath /usr/local/mongo/data --fork --logpath /usr/local/mongo/log
Run Code Online (Sandbox Code Playgroud)
我一直在网上搜索并认为它介于~/.bashrc, ~/profile, /etc/bashrc,/etc/profile或之间~/.bash_profile。尽管我已经尝试过这些并且它们似乎在终端启动 而不是 Mac 启动时运行。我错过了一个文件吗?