As others have pointed out, tail -f file is the most common solution. The problem is that the results simply scroll, and you cannot go back and look for them if your terminal does not support it and you have enough buffered lines in your terminal.
A lesser known solution that I like is to use less ; if you type Shift - F when viewing a file with less , it will start following the end of the file, like tail -f . Alternatively, you can run less with less +F to enter this mode at startup. You can type Ctrl - C at any time to stop the file from executing, and then go up and down, search with / and use less , as usual. This can be very useful if you see something interesting in the magazine, but it scrolls from the screen or if you want to come back a bit to check something that you might have missed. When you are done searching, press Shift - F again to start the file again.
multitail looks like a nice solution for several files in separate windows; if you are viewing multiple files with tail -f , each will alternate with each other (with headers to distinguish them), which may not be the way you want to view them.
tail -f (i.e. capital -F , unlike lowercase -F ) is a non-standard flag (available for Linux, Cygwin, MacOS X, FreeBSD and NetBSD) that works best for viewing log files that can sometimes rotate; rename the log file for the process, and then create a new log file instead to avoid too much of a single log file. tail -f will continue to follow the old file, which is no longer the active log file, and tail -f will follow the creation of the new file and instead start following it. If you use less to monitor the file, you can use the --follow-name flag to make less same.
(thanks to the ephemerality for hints on less +F and less --follow-name )
Brian Campbell Jan 20 2018-10-20 16:41
source share