Categories
Uncategorized

Tail Log

I don’t know why I never thought of this before… Occasionally I need to run a script…

I don’t know why I never thought of this before…

Occasionally I need to run a script that can either dump everything to the screen for me to look at as it’s running, or I can direct to a file to check when it’s done. This is in efficient. So while I used to do this:

perl foo.pl

or this:

perl foo.pl >foo.log

I now do this:

perl foo.pl >foo.log &

which runs the script, and sends the output to a file, while running the process in the background. If you want to see what’s going on, just type:

tail -f foo.log

to continually watch the output. Of course you can do grep’s on the file, or just tail part of it, or whatever, but it’s nice to be able to keep that long process running, and check on it’s progress quite easily.

It’s the little things, you know…

1 reply on “Tail Log”

Comments are closed.