)find . -type d -exec chmod 0755 {} \; find . -type f -exec chmod 0644 {} \;
#!/usr/bin/perl -w use strict; use File::Find; + find( { wanted => sub{ chmod((-f)?0644:0755,$_) if -d||-f } }, defined $ARGV[0] ? $ARGV[0] : '.' );
UPDATE:
just had a privmsg discussion regarding this snippet and it looks that some people seem to be missing the point - goldclaw's reply is doing a DIFFERENT thing from my original goal. He somehow explained in his reply that files get chmod-ed to 0755 "if it has one or more execution bits allready set",
but that's not my intention (i.e. remember Apache and XBitHack and you'll see why).
I really hope this update will clarify this missleading issue, as I see many users using chmod's X flag without perfectly understanding what's its functionality.
In reply to 'pubify' directory tree by AltBlue
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |