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

This question already has an answer here:

I am currently connected to the Twitter Stream, and I would like to count the number of lines of data as they come in. I know I can do wc-l to just count the lines, but I want it to be auto-updating. Kind of like how tail -F works, but instead, I want a running tally of how many records I've received.

Is there a simple command to do this in UNIX?

share|improve this question

marked as duplicate by Stéphane Chazelas, slm, Ramesh, Anthon, Braiam May 1 '14 at 17:45

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

(the difference being that the other question asked for a GNU solution while this one asks for a Unix one, but the accepted answer here is Linux specific, while the one there is POSIX (so GNU, Unix and Linux compatible)). – Stéphane Chazelas May 1 '14 at 13:43
up vote 4 down vote accepted

watch can be used to repatedly run a command. The -n option specifies the time in seconds that the command is repeated. Commands that include pipes need to be quoted

$ watch -n1 'wc -l < twitter.stream'
share|improve this answer

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