Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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?

share|improve this question
This is often called “tailing”, after tail -f. See also How to have tail -f show colored output and more generally the tail tag. – Gilles May 5 '11 at 22:41
up vote 11 down vote accepted

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.

share|improve this answer
tail -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 6 '11 at 0:58

Your Answer


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.