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?


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

tail -f filename | tee output.txt
  • Sounds too good to be true! I'll test it on Monday. – Jeremy Dec 11 '11 at 7:06

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.