~ - Home Directory
. - Current Directory
.. - Enclosing Directory
$ cd ~/Dropbox/code
$ cd ..
$ pwd
/Users/rd/Dropbox
$ ls
$ ls -la
$ la
$ ls -tla
$ mkdir projects
$ mkdir -v code
$ mkdir -p code/sinatra-app/public code/sinatra-app/views
$ ls --help
ls: illegal option -- -
usage: ls [-ABCFGHLOPRSTUWabcdefghiklmnopqrstuwx1] [file ...]
$ man --help
$ man ls
$ mv projects old-projects
$ cp app.rb old-projects/
$ cp -R old-projects really-old-projects
$ rm junk.txt
$ rm -rf really-old-projects
$ echo
$ grep
$ la | grep .txt
$ tar
$ cat
$ head
$ tail
$ brew
$ tree
$ which
$ whoami
$ curl
$ nano
$ say 'Hello'
Add #!/usr/bin/env ruby to top of the file.
$ chmod +x food_trucks.rb
$ ./food_trucks.rb
- /usr/local/bin should be first!:
export PATH=/usr/local/bin:$PATH - Always append to the end of the $PATH
- Postres.app:
export PATH=$PATH:/Applications/Postgres.app/Contents/Versions/9.3/bin
$ printenv
$ echo $PATH
$ brew doctor
$ nano ~/.zshrc
$ nano ~/.bashrc
$ which ruby
$ chruby
ruby-1.9.3-p545
ruby-2.0.0-p451
ruby-2.0.0-p594
ruby-2.1.2
ruby-2.1.3
* ruby-2.1.4
ruby-2.1.5
$ chruby ruby-2.1.5
$ echo "ruby-2.1.5" > ~/.ruby-version
$ ln -s "/Applications/Sublime Text 2.app/Contents/SharedSupport/bin/subl" /usr/bin/subl
$ which atom
/usr/local/bin/atom
$ la /usr/local/bin/atom
$ cd ~/Dropbox/code/launchvotes
$ atom .
$ subl .
$ ps aux | grep safari
$ kill 123
$ tar -zxvf plans_to_take_over_the_wolrd.tar.gz
$ tar -xvjf area51_research_documents.tar.gz2
$ tar -tf filename.tar.gz
slooooooow
$ grep -rn collection_select ~/Dropbox/code
faster
$ brew install ack
$ ack collection_select ~/Dropbox/code
way fast
$ brew install the_silver_searcher
$ ag collection_select ~/Dropbox/code
$ find ~ -name "time.rb"
say 'Thank you'
Use CTRL+A to move to the beginning of the line in your terminal.