Right now I'm essentially executing tail /var/log/syslog
manually every once in a while. Is there something that lets me see what's being added continuously, or do I need to write something myself?
Asked
Active
Viewed 261 times
4

Gilles 'SO- stop being evil'
- 829,060

Kit Sunde
- 4,504
- 10
- 31
- 34
1 Answers
11
I believe you're looking for the -f
switch. It will continue to follow the the log file as it changes.
tail -f /var/log/syslog
You can vary the number of lines that are output using the -n
switch as well:
tail -f -n 20 /var/log/syslog
See man tail for more information.

cjm
- 27,160
-
3tail -f | grep ... | while read line; do ...; done is an extremely common scripting idiom among sysadmins. (Yes variants of of it using popen() styled subprocesses count as using the same idiom). It's used to selectively process logged events in near real-time (for example to send alerts or initiated automated remediation scripts). – Jim Dennis May 06 '11 at 00:58
tail -f
. See also How to have tail -f show colored output and more generally thetail
tag. – Gilles 'SO- stop being evil' May 05 '11 at 22:41