Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

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 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 at 13:43

1 Answer 1

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.