Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

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

1 Answer 1

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
7.1-RELEASE
[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
7.1-RELEASE
[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

 
discard

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.