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

I looked in /var/log/ but there isn't any log files that records ports log, and I just found this person asking the same thing in other forum and get an answer which stating there is no such file. If that's the case how should I read error messages? with more?

share|improve this question
up vote 2 down vote accepted

There's script(1) command which makes typescript of terminal session:

[spongebob@conductor ~]$ script session.log
Script started, output file is session.log
[spongebob@conductor ~]$ uname -r
[spongebob@conductor ~]$ cd /usr/ports
[spongebob@conductor /usr/ports]$ exit

Script done, output file is session.log

Then you can read the log:

[spongebob@conductor ~]$ cat session.log
Script started on Mon Jan 10 03:48:31 2011
[spongebob@conductor ~]$ uname -r
[spongebob@conductor ~]$ cd /usr/ports
[spongebob@conductor /usr/ports]$ exit

Script done on Mon Jan 10 03:48:44 2011
[spongebob@conductor ~]$

If you omit the argument file, then script saves all dialogue in the file typescript.

Hope that helps.

share|improve this answer
wow I didn't know such a convenient command exists! Many thanks!! – user3927 Jan 19 '11 at 8: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.