From http://www.techrepublic.com/article/20-terminal-shortcuts-developers-need-to-know
20 shortcuts to help you get work done in Terminal on your Mac.
Option/Alt + Left or Right
This shortcut allows you to move the cursor between separate words in a command line. Use Option and the left arrow to move back and use Option with the right arrow to move forward down the line.
Control + W
Using this keyboard combination will delete the word immediately before, or to the left of, the cursor.
Escape + T
This will swap the two words that appear immediately before the cursor. So, if "this is" sits before the cursor, using Escape and T will change that to "is this."