How can I tail a file and capture the output for one minute?

2

I am tailing a log file. How can I capture the output for one minute?

blackwing

Posted 2010-08-18T22:46:50.377

Reputation: 511

Answers

8

tail -f mylogfile & sleep 60; kill $!

Gilles 'SO- stop being evil'

Posted 2010-08-18T22:46:50.377

Reputation: 58 319

0

You fail to mention your OS, Shell or other pertinent infos. Therefore, I recommend entering your command and watching the clock for one minute, then sending the 'break' command.

The Cron command springs to mind to schedule tasks assuming you are running an Linux/UNIX box.

Sam

Posted 2010-08-18T22:46:50.377

Reputation: 477