The lines "missing" from the file might have been sent to stderr (or stdlog) instead of stdout, and with your redirection will not go into the file. You can use something like: cmd 2>&1 > filename.log to send both stderr and stdout to the log file. The "Advanced Bash-Scripting Guide" is a great read for learing shell programming: http://www.tldp.org/LDP/abs/html/ and in particular the following chapter for I/O redirection: http://www.tldp.org/LDP/abs/html/io-redirection.html