Suppose in bash you start writing a command like:
$ rm -rf /foo/bar/really/long/path/here
and then realize you don\'t want to execute this
If you are using Bash in vi mode (set it with set -o vi), then press Esc to switch to the normal mode of vi, and type dd to delete the current line!
set -o vi
dd