=== Unix Tricks === * [[chmod | chmod ]] * [[chown | chown ]] * See the output of cron by doing sudo grep CRON /var/log/syslog * Count lines in files in current directory find . -type f | xargs cat | wc -l * MTA errors in cron can be solved by installing Postfix aptitude install postfix. Select the Local only configuration. * tail -f /var/mail/. do tail -f /var/mail/root to look at cron errors sent to root's email * bash scripts start with #!/bin/sh. If you get errors, you may have leading BOM characters (ef bb bf) in your file. Check this by doing head -n 1 myscript.sh | hexdump -C * 2>&1 means send stderr to stdout. * redirects stdout to afile.txt. echo test 1> afile.txt * To redirect stderr, you do echo test 2> afile.txt