Saving output of an application
Giorgos Keramidas
keramida at ceid.upatras.gr
Tue May 30 16:01:36 PDT 2006
On 2006-05-30 21:52, Lars Stokholm <lars.stokholm at gmail.com> wrote:
> I don't know how to explain this, but I remember that there is some
> way of saving everything that's going on in the terminal, I just don't
> remember the command for doing so. I think it's something along the
> lines of (e.g.):
>
> # something file.name (this would start logging)
> # portupgrade -a (or anything else)
> # someting something (this would stop logging and close the file)
>
> file.name would then contain all of the output of portupgrade. Can
> someone help me with the right command? :)
The script(1) utility is the one you are looking for.
If you are using bash or a Bourne shell, you can also use:
$ cmd 2>&1 | tee logfile
or when multiple commands are involved, parentheses:
$ ( cmd ; cmd2 ) 2>&1 | tee logfile
I use the Bourne shell redirection trick to save the output of builds,
for instance:
csh# sh
$ cd /usr/src
$ ( make KERNCONF=FOO buildworld buildkernel ) 2>&1 | tee logfile
It comes very handy whenever I need to go back and see the log of
the build :)
More information about the freebsd-questions
mailing list