4

I'm on Ubuntu.

Is it possible to open putty and watch as a log file updates right in terminal? Like if stdout would have been directed in terminal?

For example I have one application's stdout and stderr directed into a file and want to watch how my app is starting from another terminal.

Ward - Reinstate Monica
  • 12,788
  • 28
  • 44
  • 59
Somebody
  • 364
  • 1
  • 6
  • 17

2 Answers2

7

If you want to follow a log file, you can use the famous:

$ tail -f /path/to/log/file
Khaled
  • 35,688
  • 8
  • 69
  • 98
6

In addition to tail -f, you can also use less with the +F parameter, which will allow you to keep track of new new input, but at the same time have access to all interactive functions of less, such as searching.

In some situations it is better to use tail -F (or less --follow-name) instead of tail -f. This assures that you continue following new input even if the file name changes. It is especially useful with some log-rotating software.

jankes
  • 301
  • 1
  • 7