sarpay
7/23/2013 - 11:26 PM

Bash Commands

Command Line Interface Commands (Mac)#

if having difficulties with EACCESS, run:
(you no longer need sudo declarative after this)

sudo chown -R USER_NAME /usr/local/lib/node_modules/
sudo chmod -R 775 /usr/local/lib/node_modules/
npm install -g phonegap

change to root directoy

cd /

change to user/<username> directory

cd ~

change to parent directoy

cd ..

change to specific directory

cd /usr/local/bin

move from one directory to other

mv temp/.git code/.git

list files within directory

ls

clears the screen

clear

create directory

mkdir wwwhost

switch to root (admin account):

sudo -i (sudo means super do)

logout of root (admin account):

exit

Cancel any command

ctrl+c

Kill an App

killall [appname-without-extension]

ex: killall Finder

open the enclosing folder:

open /Users/sarpay

unhide library directory:

chflags nohidden /users/sarpay/library

show hidden files:

defaults write com.apple.finder AppleShowAllFiles true; killall Finder

remove recursive force the sepcified folder

rm -rf sample-project/

delete an entire folder including its contents (WITH CONFIRMATION):

rm -iR /Users/sarpay/desktop/JustFacts

delete an entire folder including its contents (WITHOUT CONFIRMATION):

rm -R /Users/sarpay/desktop/JustFacts

delete a file (WITH CONFIRMATION):

rm -i MyFile.rtf

is node and npm installed?

cd /usr/local/bin ls

node and npm should be listed as a result

is angular installed?

cd /usr/local/lib/node_modules ls

@angular should be listed as a result

change screen capture default setting

defaults write com.apple.screencapture type jpg