terminal
What is the difference between node vs nodejs command in terminal?
This is highly dependent on many factors. Mainly, it depends on what node and nodejs in your shell actually are. You can check this using type node / type nodejs and/or which node / which nodejs (or perhaps whereis). This also depends on the OS and the shell. My guess is that which -a node … Read more
Terminal: Where is the shell start-up file?
You’re probably using bash so just add these 3 lines to ~/.bash_profile: $ cat >> ~/.bash_profile export WORKON_HOME=$HOME/.virtualenvs export PROJECT_HOME=$HOME/directory-you-do-development-in source /usr/local/bin/virtualenvwrapper.sh ^D where ^D means you type Control+D (EOF). Then either close your terminal window and open a new one, or you can “reload” your .bash_profile like this: $ source ~/.bash_profile
What does the colon do in PATH
: is the separator. The PATH variable is itself a list of folders that are “walked” through when you run a command. In this case, the folders on your PATH are: /Users/chengluli/anaconda/bin /Users/chengluli/.rbenv/shims /
Setting default database for MongoDB shell
Command Line You can select the database to use on the mongo command line, eg for ‘mydb’: mongo mydb If a database name is not provided, ‘test’ will be used. In .mongorc.js If you want to set a default database without specifying on the command line each time, you can add a line to the … Read more
How to run a script as root on Mac OS X? [closed]
As in any unix-based environment, you can use the sudo command: $ sudo script-name It will ask for your password (your own, not a separate root password).
How to format console output in columns
You can use the column command: me@home$ column -t output.txt CHAR.L 96.88 -6.75 (-6.49%) MXP.L 12.62 -1.00 (-7.41%) NEW.L 7.88 -0.75 (-8.57%) AGQ.L 17.75 -0.62 (-3.40%) RMP.L 13.12 -0.38 (-2.75%) RRR.L 3.35 -0.20 (-5.71%) RRL.L 7.95 -0.15 (-1.85%) SOU.L 1.73 -0.10 (-5.22%) YELL.L 5.47 -0.04 (-0.73%) AMC.L 9.75 -0.01 (-0.05%) PLU:USOP 95.40 0.00 (+0%) BP-.L … Read more
double click and select the path(including ‘/’) in Terminal.app
Given the age of this question, you have probable found the answer elsewhere already, but if not, here’s how to do it in “newer” versions of Terminal (Leopard 10.5 and Snow Leopard 10.6)… ⌘ ⇧ double-click See also here. Just to summarize: to select a path or a URL: command–shift–double-click ⌘ ⇧ double-click to select … Read more