Reproduce previous stdout output without running previous command

Lord Of Hyphens lordofhyphens at
Tue Jun 9 03:48:23 UTC 2009

On Mon, Jun 8, 2009 at 10:44 PM, Daniel Underwood <djuatdelta at>wrote:

> 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[1] >> ~/textfile.txt
> Hopefully this has made (some) sense.
> <freebsd-questions at>

Check the manpage for tee. That should give you a solution you're looking

--Joseph Lenox

"Nothing unreal exists." - Kiri-kin-tha's First Law of Metaphysics.

More information about the freebsd-questions mailing list