Command to update terminal as file is updated

1

1

I'm looking for a way to have the access log for my nginx install scroll up the terminal as lines are added to the log. I think I need a command like cat access.log | diff but I'm not sure exactly what it should be.

H4Z3Y

Posted 2011-03-13T13:58:21.073

Reputation: 43

Answers

2

Use tail with -f:

tail -f access.log

From man tail:

-f, --follow[={name|descriptor}]
output appended data as the file grows; -f, --follow, and --follow=descriptor are equivalent

Lekensteyn

Posted 2011-03-13T13:58:21.073

Reputation: 5 236

cheers, worked perfectly! – H4Z3Y – 2011-03-13T14:05:03.517