The command line shortcut to comment out the current line

bashcommand linekeyboard shortcuts

I am looking for the command line shortcut to comment out the current line in the terminal.

For example, I might enter git commit -am "a comm and then realize I don't actually want to commit yet. I'd press the key combination and my half entered line would be commented out and entered, thus saving it into history, but not actually executing.

Anyone know this keyboard shortcut?

Best Answer

Documented in the bash manual here:

M-# or AltShift3

Related Question