Use case: I'm working in bash/terminal and have been typing several commands and I've just run something and it's spewed some output. I'm trying to find where that output started and have to visually search the page to see where the command is that I typed.
Now had I anticipated that I was going to struggle to find the start of the content I would have run clear && <my command>
.
So what I'm looking for is something like clear -1
which would (1) grab all the content since the last command, (2) run clear
, and then (3) paste the content into the terminal.
<my command> | less
? – John1024 Apr 9 '15 at 1:05clear && <my command>
works (or quickerCTRL
+L
as @SabinReneFigaro pointed out) just as well but again requires that you know ahead of time. I'm looking for something that will work after the fact. – Guy Apr 10 '15 at 17:15bash
's precognition is worse then yours... Any solution that I can think of that adds precognition tobash
would be ugly. e.g. you could spawn a new terminal for each and every command you type and then have to close it after the command finishes... – Fabby Apr 12 '15 at 10:28