=== Unix Tricks ===

  * [[chmod  | chmod ]]
  * [[chown  | chown ]]
  * See the output of cron by doing <code>sudo grep CRON /var/log/syslog</code>
  * Count lines in files in current directory <code>find . -type f | xargs cat | wc -l </code>
  * MTA errors in cron can be solved by installing Postfix aptitude install postfix. Select the Local only configuration.
  * tail -f /var/mail/<your_username>. do <code>tail -f /var/mail/root</code> 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 <code>head -n 1 myscript.sh | hexdump -C</code>
  * 2>&1 means send stderr to stdout.
  * redirects stdout to afile.txt. <code>echo test 1> afile.txt</code>
  * To redirect stderr, you do <code>echo test 2> afile.txt</code> 