Thursday, April 25, 2024
4
rated 0 times [  4] [ 0]  / answers: 1 / hits: 14948  / 2 Years ago, wed, september 28, 2022, 5:35:31


I am trying to tail file with pagination:



tail -f foo.txt | more


This works fine until file gets, lets say, 200 lines injected, when this happens nature of tail command is to go to end of file, at that point I lose track of trailing the log.



Is there a way to avoid this?


More From » command-line

 Answers
3

My solution is this:



less some-file.log


Then, in less I hit Shift+F. This causes less to update with the file. To scroll back, just hit Ctrl+C.


[#34525] Thursday, September 29, 2022, 2 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
disdry

Total Points: 133
Total Questions: 128
Total Answers: 109

Location: Greenland
Member since Fri, Jul 31, 2020
4 Years ago
disdry questions
Tue, Apr 11, 23, 11:37, 1 Year ago
Thu, Oct 13, 22, 19:09, 2 Years ago
Fri, Oct 28, 22, 15:06, 2 Years ago
Sat, Feb 25, 23, 11:33, 1 Year ago
;