Ask Ubuntu is a question and answer site for Ubuntu users and developers. 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

tail -f will update the file once new data is inserted , but if the whole file is being rewritten it will give an error .

is there any other option to keep reloading the whole file ?

Thank you

share|improve this question

man tail gives :

tail -F or tail --follow=name --retry to keep tail watching file even if all the file is rewritten.

share|improve this answer
no it gives 'tail: 1.dat: file truncated' and does not reload the new content – Ronan Dejhero Nov 8 '12 at 8:36
@RonanDejhero : if you didn't use the -F option, add the --retry to the --follow=name – Cédric Julien Nov 8 '12 at 8:44

Have a look at multitail. The following output was produced through the command sudo multitail --follow-all -i /vor/log/syslog. It shows the end of one file, a notice that the file got truncated and the beginning of the new syslog entry:

Nov  8 09:06:36 rfc1178 anacron[22633]: Updated timestamp for job `cron.daily'11-08
tail: �~@~^/var/log/syslog�~@~\ wurde ersetzt;  folge Ende der neuen Datei
----------- file got truncated /var/log/syslog 2012/11/08 09:08:02-----------
Nov  8 09:08:02 rfc1178 rsyslogd: [origin software="rsyslogd" …
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.