George
George

Reputation: 3619

How to save shell screen to file verbose?

Need to keep a copy of what has been already output to the screen (i.e. the standard output), in shells of both Linux and OS X. Better if the colored text can be kept.

Upvotes: 1

Views: 456

Answers (2)

trojanfoe
trojanfoe

Reputation: 122391

Run your command through tee (manpage):

$ mycommand | tee ~/Documents/output.txt

This will output to both the screen and to the file specified on the tee command line and will work in any terminal session (i.e. ssh, not just Terminal.app).

Upvotes: 1

Barmar
Barmar

Reputation: 781028

Use the menu command Shell > Export Text As....

You can also use the Unix script command to save everything automatically as it's happening.

Upvotes: 1

Related Questions