shows all of the interfaces and their IPs
ifconfig
ipconfig getifaddr en0
ifconfig | grep "inet "| grep -Fv127.0.0.1| awk '{print $2}'
shows all of the interfaces and their IPs
ifconfig
ipconfig getifaddr en0
ifconfig | grep "inet "| grep -Fv127.0.0.1| awk '{print $2}'
Note that with PostgreSQL 9.0 (and probably newer) on Mac OS 10.6.8 (and probably older), in order to prevent the PostgreSQL server from auto-starting, you have to:
/Library/LaunchDaemons/
com.edb.launchd.postgresql-9.0.plist
in an editor as root
(replace 9.0
with your correct version number), e.g. sudo vim com.edb.launchd.postgresql-9.0.plist
.<key>RunAtLoad</key>
<true/>
to <false/>
That should do it. Also, if you want to stop the server immediately, without restarting, su
to postgres
and run /Library/PostgreSQL/9.0/bin/pg_ctl stop -D<your data dir>
. You can find out which is your current data dir with ps aux|grep postgre
.
Source: http://forums.enterprisedb.com/posts/list/2240.page#8321
For example install MondoDB 2.6.12 on macOS Catalina
Download, extract and move:
wget http://downloads.mongodb.org/osx/mongodb-osx-x86_64-2.6.12.tgz
tar xzf mongodb-osx-x86_64-2.6.12.tgz
mv mongodb-osx-x86_64-2.6.12/ /usr/local/mongodb/
Add to file ~/.zshrc
this:
export PATH="$PATH:/usr/local/mongodb/bin"
PS: .bash_profile
or .profile
not worked in my case
Mkdir directory for data and set rights:
mkdir -p ~/data/db
chown -R mongodb.mongodb ~/data/db
Run MongoDB:
mongodb --dbpath ~/data/db
sudo lsof | grep nsurl
ps -ef|grep nsur
sudo fs_usage -w | grep nsurl
export PS1=»\[\033[36m\]\u\[\033[m\]@\[\033[32m\]\h:\[\033[33;1m\]\w\[\033[m\]\$ «
export CLICOLOR=1
export LSCOLORS=ExFxBxDxCxegedabagacad
alias ls=’ls -GFh’