Take the 2-minute tour ×  I was not sure if this was for
StackOverflow or here, I settled for here. I was wondering which
file I should place this bash command in so it will be run on
startup.  # Start the MongoDB server
/Applications/MongoDB/bin/mongod --dbpath /usr/local/mongo/data
--fork --logpath /usr/local/mongo/log  I have been scouring the
net and think it is between ~/.bashrc, ~/profile, /etc/bashrc,
/etc/profile or ~/.bash_profile. Although I have tried these and
they seem to run on terminal startup not Mac startup. Am I
missing a file here?  Thanks for any help you can give.
share|improve this question  4 Answers 4  up vote 19 down vote
accepted  Officially none of these. The Apple suggested way is
to use launchd. A Gui to set this up is lingon  As for the files
you mention the ones in the home directory ~/.bashrc, ~/profile,
~/.bash_profile are only started when you login via a terminal.
EDIT: The ones in /etc are run by the shell starting for all
users before the one in home directory. bash manu