Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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.

share|improve this question

2 Answers 2

up vote 7 down vote accepted

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

$ tail -f /path/to/log/file
share|improve this answer
    
Damn forgot about tail :D ty again. Used it inside gltail. –  Somebody Feb 25 '12 at 15:27
    
@Beck: If you want to view the log while writing in the same terminal, you can use tee. –  Khaled Feb 25 '12 at 15:34

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.

share|improve this answer
    
interesting, will check that out. have been thinking about such a feature... –  Tom H Feb 26 '12 at 23:14

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.