Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I would like to keep not just history of my commands, but the output as well. If I type ls then it should append to a file
~/Desktop% ls

Is there anything like that? Or should I try and code this with preexec() and all that?

share|improve this question

migrated from Sep 25 '12 at 13:42

This question came from our site for professional and enthusiast programmers.

A couple questions. Do you want to be able to distinguish between information provided in stdin, from stdout and stderr? Or do you literally just want a log of the text exactly as it is displayed in the virtual terminal, with no inherent ability to distinguish between data output by a program on stdout/stderr and data keyed into the terminal via the keyboard or other stdin device? – allquixotic Sep 25 '12 at 13:48
yep. just like saving what I see in the terminal. – pvinis Sep 26 '12 at 23:53
up vote 1 down vote accepted

I used a spyshell. A shell that just runs script, and that opens zsh. I cannot find the link, so I made a gist. Here it is:

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.