View only the new entries in a growing log file
You can try:
tail -n0 -f x.log
From man page:
-n, --lines=K
output the last K lines, instead of the last 10; or use -n +K to output lines starting with the Kth
You can use the -n0
option to show 0 lines. So
tail -n0 -f some.log
You can also use less
command like
less file_name.log
(log file will be opened and will show first page of the log file)- press shift + f (to act same as like tail -f)
- In case if you need to search for any keyword in log file. press ctrl + c to exit the tail mode and search for the keyword as /keyword and ?keyword.