Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

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

In the command line, I typed:

script -a myfile

Then, I typed the some standard commands.

When I opened the myfile using vi, the file was empty. Why is that? And, also, any tips on using the ttyrec and ttyplay commands?

share|improve this question
Did you exit the shell before viewing the file? – ddeimeke Nov 25 '11 at 14:34

It doesn't look like your implementation of script is flushing the output by default. If it available, try this:

script -f -a myfile

That said, I would suggest that you use more or less commands to view the file. In fact, you probably want to view that file in a separate login session, as your vi/more/less session will be flushed to the file in realtime.

share|improve this answer
Thanks a lot Rilindo, it works.... – Ruby Nov 27 '11 at 6:19

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.