Clear the screen/pane (when
Ctrl + L won't work)
⌘ + K
Here's a cheatsheet for iTerm2.
Honestly, I think clearing lines this way is a bad habit. It's not universal.
If you have a injected proc in metasploit with a terminal, and you hit your habitual keyboard interrupt sequence of choice.... Well, keyboard interrupt in this context will kill your shell and could kick you out of the injected process. (So much for your exploit. Sure hope someone restarts that box without getting suspicious...) It took me a year to get out of this habit and I still catch myself. Same problems with commands that don't terminate on their own like
ping without specifying a count. Do that in metasploit without doing
ping -c 4 <ip> and you'll remember how screwed you are because you have to do an interrupt to stop it, and that interrupt will kill your session.
Instead, I would recommend using the
home key, entering a comment character, then
enter. This has the added benefit of saving the long line in history. You worked hard to type that line. There's probably some goodness in there you might need later. And, once in your history, you can arrow up to it and simply
home and delete the
# character. Think of it like an arm/disarm toggle.
In bash that would be
#. Oddly enough, I don't see a comment character for iTerm2...
Ctrl + L does't work) try
⌘ + K. Considering using
home comment char