私はちょうどこのU&L Q&Aで答えが見つかったというタイトル:どのように行うにはtail -f、ログのファイルを回転させますか?。
使用tail:
(システムにGNUテールをインストールするオプションがある場合)
tail -F program.log
尾のmanページ:
-f, --follow[={name|descriptor}]
output appended data as the file grows; -f,
--follow, and --follow=descriptor are equivalent
-F same as --follow=name --retry
--retry keep trying to open a file even when it is or becomes
inaccessible; useful when following by name, i.e., with
--follow=name
キーは--retryスイッチです。これは、tail名前でファイルの追跡を再試行し続けるようにコマンドに指示します。-FスイッチはAの両方ん-fと--retry。
を使用して less
@StephaneChazelaがコメントで指摘したように、以下は機能しません。
tail -F program.log | less
あなたが持っている唯一の他のオプションは、それが--follow-nameスイッチとlessファイルを直接サポートしていると仮定して、lessを直接使用tailすることです。
less --follow-name program.log
tail -F program.log | less機能します