Stack Exchange Network
Stack Exchange network consists of 181 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.
Ask Different is a question and answer site for power users of Apple hardware and software. It only takes a minute to sign up.
Sign up to join this community
Anybody can ask a question
Anybody can answer
The best answers are voted up and rise to the top
Just moved off from windows into a Mac. I used to use Putty and it has a feature of logging sessions into a folder so everything that happens (stdin/out) goes also to a folder for historic record.
I would like to have the same thing with Mac Terminal app.
There are two ways I am aware of:
- Run all the commands you want in Terminal. Before closing the window go to Shell -> Export Text As… (or press CMD+S). This exports a text file with all the input and output of that session.
scriptat the beginning of your session, e.g. with:
/usr/bin/script ~/Desktop/Terminal.log. When you’re done with the session type
exitand a log file with all the input/output will be written (an example can be found in this other answer).
I found that the first method handles colours in the output better: it simply ignores it and writes the text to the file.
script method writes control characters such as
[1m[0m[1m[36m instead, which creates noise in your log. If you don’t have any coloured output, that’s no problem. If you do, perhaps there’s an option for
script that can handle this.
You must log in to answer this question.
Not the answer you’re looking for? Browse other questions tagged .