• To add a directory to $PATH:
edit ~/.bash_profile
  • To find folder size
cd folderName
du -hs
  • To compare contents of two folders recursively:
  • diff -rq folderA folderB
rq: r tells it to scan resucrively
q tells it "quick" - do not display line-by-line differences

  • To compare two text files' contents:

wdiff -s a.txt b.txt

  • To install wdiff:

ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" < /dev/null 2> /dev/null

and press enter/return key. Wait for the command to finish.
brew install wdiff

  • To extract a jar file:
jar xf filename.jar

  • To display directory tree: