Reproduce previous stdout output without running previous command
djuatdelta at gmail.com
Tue Jun 9 03:44:35 UTC 2009
OK, this is perhaps a weird question, capable of being very confusing.
So let's take a "for instance".
Suppose I run something like the Linux command "fdupes" on a directory
with many large files. This operation will take considerable time to
complete. When it completes, a lot of output is send to stdout
(displayed on the terminal).
Further suppose that after running the command, I decide I want to
save the output to a text file, so I can analyze the results outside
of the terminal. What can I do? Well, I can do a traditional
"copy-and-paste", or I could re-enter the previous command and send it
to a text file (which I ought to have done in the first place).
But is there another option? Is there some variable (such as,
hypothetically, $output[n], where n=some integer index) that I could
use to store the results in a text file? Such an option might look
like the following:
$ fdupes -r ~/directorywithlotsoflargefiles
(.....lots of output, woops, should have sent to a text file!....)
$ output >> ~/textfile.txt
Hopefully this has made (some) sense.
More information about the freebsd-questions