LorenVS
LorenVS

Reputation: 12857

Continually output file content to console?

Quick question, hopefully... I'm building an application with a fairly extensive log file. I'd like the ability at any time to monitor what a specific instance of my application is doing. I could open and close the log file a bunch of times, but its kind of a pain. Optimally, as lines are written to the log file, they would be written to the console as well. So I'm hoping something along the lines of "cat" exists that will actually block and wait for more content to be available in the input file. Anyone have any ideas?

Upvotes: 0

Views: 1154

Answers (5)

Marius Gedminas
Marius Gedminas

Reputation: 11337

An alternate answer for variety: If you're already looking at the log file with less, press capital F to get it to do the same thing tail -f does: wait for new content to be appended and show it.

Upvotes: 2

R Samuel Klatchko
R Samuel Klatchko

Reputation: 76531

tail -f logfile

Upvotes: 2

Alberto Zaccagni
Alberto Zaccagni

Reputation: 31560

tail -f yourlogfile

Upvotes: 2

Fosco
Fosco

Reputation: 38506

tail -f logfile

this will keep it open and 'follow' the new output.

Upvotes: 3

Related Questions