find ~/httpdocs -maxdepth 1 -name \*.php -exec perl -pi -w -e "s/\<\/body\>/\<\?php\ include_once\('includes\/footer_inc\.php'\);\ \?\>\<\/body\>/g" {} \;
THANK YOU KYRA!!!
Hourly cron job:
crontab -e * 1 * * * /usr/bin/wget -O - -q -t 1 http://www.domain.com/cron.php
This rsyncs from a ssh server to your local machine, excluding svn files, and it has delete flag so its a mirror copy.
rsync -av --delete --progress --exclude '.svn/' username@domain.com:/some/directory ~/Desktop/backup/
find . -name '*.tar.gz' -exec tar -zxf {} \; rm *.tar.gz;
The following commands reset all your files and directories back to the server defaults of 755 and 644.
find . -type f -exec chmod 644 {} \; find . -type d -exec chmod 755 {} \;
ln -s {target-filename} {symbolic-filename}du -ch repo | grep 'total'
find . -name *.DS_Store -type f -exec rm {} \;echo hi > file.txt
single ‘>’ replaces file
echo hi >> file.txt
double ‘>>’ appends to file
somecommandthatmakeserrors 2> error_log.txt