How can I clear the current line of the Windows command prompt?
The Escape (Esc
) key will clear the input line.
In addition, pressing Ctrl+C
will move the cursor to a new, blank line. This may be helpful as the input you just reviewed remains visible while you type the new command.
Aside from the two that Myyrddin covered - Esc
and Ctrl+C
- there are also two more shortcuts related to clearing the current input in CMD.
Ctrl+Home
will clear all characters in the input before the cursor (equivalent to Ctrl+U
in Bash)
Ctrl+End
will clear all characters in the input after the cursor (equivalent to Bash's Ctrl+K
)
Both are fairly useful and, once internalised and gotten used to, could speed up editing in CMD by quite a bit.