How can I see file content in real time on Linux?

The name of the picture


How can I see file content in real time on Linux?



I have a log file which will be write some data in it continuously.



How can I see what data is being written to the file on my Linux terminal without opening the file?




2 Answers
2



You can use tail's -F option to follow in real time the changes made to your file:


tail


-F


tail -F my_file.log



Note: By default, tail prints the last 10 lines of your file. If you want to see more lines you can use the -n option:


tail


-n


tail -F -n 50 my_file.log # See the last 50 lines in real time



tail -f filename -n 100


tail -f filename -n 100



-n -> number of lines






By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Popular posts from this blog

Arduino Mega cannot recieve any sketches, stk500_recv() programmer is not responding

Visual Studio Code: How to configure includePath for better IntelliSense results

Future solutions