command + delete in terminal
If you are using emacs keybindings (default for bash, zsh, pry (ruby interpreter), python and many more), ^u (control + u) might be what you want - it erases everything prior to your cursor. If you want to stop writing the command and forget what you did, use ^c (control + c), which is, by the way, a SIGKILL(9) signal (see man signal).

By the way, the keybindings not only work on OS X 10.11, but also on all Unix-like systems I've ever seen.