Languages
[Edit]
EN

Bash - how to follow log file changes?

10 points
Created by:
Amir-Hashempur
577

There are few solutions:
1. tail + watch commands:

$ watch -n 1 tail -n 10 path/to/log/file

Note: to end watching press ctrl^c (ctrl+c)

Where:

  • -n 1 causes refreshing once per second
  • -n 10 causes reading 10 last lines from file

2. less command

$ less +F path/to/file

Note: to end watching press ctrl^c (ctrl+c); to exit less program press q key.

It is possible to enable following for opened less program by pressing shift+f keys.

Donate to Dirask
Our content is created by volunteers - like Wikipedia. If you think, the things we do are good, donate us. Thanks!
Join to our subscribers to be up to date with content, news and offers.

Bash

Bash - follow log file changes
Native Advertising
🚀
Get your tech brand or product in front of software developers.
For more information Contact us
Dirask - we help you to
solve coding problems.
Ask question.

❤️💻 🙂

Join