How do I redirect the Terminal content (the content that currently I'm looking not the entire file, when using the less
command) into a outfile until I press the Q to exit from less
?
How do I redirect the Terminal content (the content that currently I'm looking not the entire file, when using the less
command) into a outfile until I press the Q to exit from less
?
To save just the section that is currently displayed in your terminal you can use the
|
command.From
man less
:|
(the pipe symbol).
mark to select only what's visible on your terminal (or just hit Enter)tee
to save to a file e.g.tee /tmp/section_of_big_file.txt
The sequence with screenshots: