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

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
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

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

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.