Server Fault is a question and answer site for system and network administrators. 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

On the linux CLI: I have a 3 day running scan that I piped to a file (I know, should've rather had it write internally to a file).

Which brings me to my question, say I have a command

long_process_here > output.txt

Is there a way to display or output that information whilst the process is still running? Pipe what's in memory to a screen?

share|improve this question
Might wanna be more specific next time. The listed answer doesn't work on my AS400 command line, any version of Windows CLI I've worked with, or the SSH sessions into my Cisco gear, and I think that trying it on the [CLI] terminal connection on our PBX just crashed the office phone system. :/ – HopelessN00b Jul 13 '12 at 16:34
up vote 8 down vote accepted

There is a program named tee that writes input to a file as it outputs it on the screen:

long_process_here | tee output.txt

Now that you've run the program though, you can use tail to "follow" the output file and output new lines as they're added to it:

tail -f output.txt
share|improve this answer
Thanks DerfK. I know about tail - for some reason it wouldn't display anything and the text file in questions seemed to stay empty right up until the end of the amazingly endless process. Thanks a million for the tee suggestion. Unsure as to why the output script (which outputs as it runs), didn't write/pipe output to the file as it happened, guessing it was buffered in memory. – Forkrul Assail Jul 9 '12 at 12:39
@ForkrulAssail it depends on what your amazingly endless process was. For instance, if there was a grep in there, by default grep buffers a bunch of data at a time. – DerfK Jul 9 '12 at 13:46

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.