If you’re on the Bash command-line and you want to clear the current command, try the following: CTRL+U to clear to the left up-to the cursor, and CTRL+K to klear to the right after the cursor (misspelling intended). More of these Bash tricks are listed in the following article:
- Keyboard Shortcuts for Bash (howtogeek.com)
Compare this to the Microsoft Windows command-line shell where you press ESC to clear the current command. I actually prefer the Windows ESC to the Bash control sequences for clearing the current command – something Microsoft actually made easy on the command-line.