Pipe your current results in less to a file

August 29th, 2007

If you’re ever faced with having piped a long-running process into less, and then you suddenly realize you want to save those results, and don’t want to run that long-running process again, here’s a quick trick to pipe your current results out to a file:

1G (go to the first line)
|$cat – > file.txt (pipe everything to the end of the file to file.txt)

PS – Please comment if you’ve found an easier means to this end.

Leave a Reply

Powered by WP Hashcash