...more recent posts
[Updated: changed the command slightly and added stuff about directories]
For my own reference, this is one way to change every file in the current directory (and below) to 644 permissions:
find . -type f -print0 | xargs -0 chmod 0644
And to change all directories in the current directory (and below) to 755 permissions:
find . -type d -print0 | xargs -0 chmod 0755
And to delete all files in the current directory (and below) older than (say) 5 days:
find . -mtime +5 -print0 | xargs -0 rm
And to delete all empty directories in the current directory (and below):
find . -type d -empty -print0 | xargs -0 rmdir