Can anyone point me to either code or a tutorial for writing a shell script that can recursively go through an entire directory structure (starting at the current working directory, or given an required argument of where to start at) and can:
- Determine whether an item is a directory, and if it is,
chmod 755
it, or... - Determine whether an item is a file (not a dir), and
chmod 644
it.
I'm looking for compatibility with Ubuntu, Debian, RHEL-Based, etc., so I'm not tagging this with any particular language. I'd like this in Bash, but if you have a ZSH script, that will work also.