Use '-F' with 'tail' instead of '-f'
tail, there is option
-f and there is option
-F. Which one to use?
What is the difference? Most of the time, I use
-F since it works with log
-F is equivalent to
--follow=name --retry. It is useful when log files would
be renamed or deleted, which is not uncommon in systems with log rotation.
- This option ensures that we are following the latest log. In contrast, if we
tail -f log_file, we will be following that particular file even if it is renamed to
log_file.1or deleted and hence miss new log messages.
- Another cool thing about
-Fis that you can launch the tail command before log files are created.
blog comments powered by Disqus