Remember a half-typed command while I check something

A somewhat faster version of alex's Ctrl+A Ctrl+K (which moves to the front of the line and then cuts everything forward) is to just use Ctrl+U, which cuts backward on bash, and the entire line (regardless of your current position) on zsh. Then you use Ctrl+Y to paste it again


Do ctrl-A to get to start of line, prepend a hash and press return - this way it will stay in the command history as a comment and you can get back to it with cursor up

EDIT: just noticed this is a slightly more elegant variant on your #2 ;)


Hit Ctrl+A, Ctrl+K to move to the start of line and delete (kill) to the end of it. Then do your research, and when ready to continue hit Ctrl+Y (yank) to put your saved (killed) line back.