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.

If I use

tail -f *filename*

I get a real nice display of whatever is changing in a given file. However, sometimes I want to be able to search this text or otherwise look it over slowly.

Is there any way I can output just the changes to a log file between now and, say, whenever I hit Ctrl-C?

share|improve this question
add comment

2 Answers 2

up vote 3 down vote accepted

This should output everything that goes by into output.txt, if that's what you're asking for:

tail -f filename | tee output.txt
share|improve this answer
    
Sounds too good to be true! I'll test it on Monday. –  Jeremy Dec 11 '11 at 7:06
    
Works perfectly! Thank you Chris. –  Jeremy Dec 14 '11 at 0:05
add comment

Use Less's “tail mode”: run less filename, press F (“forward forever”) to scroll to the end of the file and keep reading when the file grows (like tail -f). Press Ctrl+C to drop out of tail mode and use the usual Less commands.

share|improve this answer
add comment

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.