Clear / erase a mistyped password in a terminal

command lineline-editorpasswordterminal

One thing that annoys me using Linux's terminal is when I have to type a invisble password, like when you run ssh the terminal I was wondering if there's a way to clear/erase the invisible password without relying on backspace or pressing enter key to try again

Best Answer

Typing the Ctrl-U key combination will, in most cases1, erase the entire line of input even if echo is turned off.

[1] Some programs put the terminal device into "raw" mode, where every character you type is sent to the program. Emacs is one example. They may have their own conventions for character erase/line kill processing.

Related Question