S E R V E R   S I D E
View current page
...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

- jim 12-08-2008 11:07 pm [link] [add a comment]

older posts...