#!/usr/bin/sh TOPDIR="/var/www/test" find $TOPDIR -type f -print0 | xargs -0 chmod 664 find $TOPDIR -type d -print0 | xargs -0 chmod 2775 chown -R -1:1005 $TOPDIR