Switch Your Bash One-Liner Into Your Editor

We all write over-long Bash one-liners to get something done. They can get difficult to edit when they start taking up more than one line.

Fortunately, Bash allows you to switch from Bash to your editor so you can easily continue editing the command in a real editing environment and run it on exit.

All you need to do is to hit:

CTRL+x CTRL+e

while your working on your command. When you do you and your command will be loaded into whatever editor you have set as you $EDITOR environment variable.

As soon as you exit the editor the command will be executed.