Say I've got a text file
file.txt and program
program.rb writes stuff to
program.rb finds it. How can I view the population of the text file from the terminal?
This is commonly done with
$ tail -f file.txt
tail utility outputs the tail of a file or stream, i.e. the last part of it (the 10 last lines by default). With the
-f flag, it will not exit once it has arrived at the end, but continue polling the file or stream for new data and output it whenever it arrives.
This is commonly done to manually monitor log files, or, as in your case, to view the partial result of a running program.
See also question 291932 to learn the difference between
tail -f and