via SuperUser:Terminal Tips and Tricks For Mac OS X

  • open . #Opens the folder you’re currently browsing in Finder.URLs, images, documents.

  • open -a Preview image.png #overriding the default program set for the filetype.

  • say “Hello there.” #text-to-speech.

  • !! #Runs the last command again; sudo !! to rerun the last command using sudo.

  • mdfind fileName #-onlyin for directory specified; -name for matching file names only.

  • python -m SimpleHTTPServer 8000 #Start a quick webserver from any directory.

  • qlmanage -p 2>/dev/null #alias as ql,launch quicklook on a file from the command line