Chmod either files or directories - in all subdirectories

Chmod either files or directories - in all subdirectories

How to use chmod either on files or on directories only. more >>

Contents

chmod on files only

If you want to chmod all files in current directory and
all subdirectories enter:

find . -type f -exec chmod 644 {} \;


or

find . -type f -print0 | xargs -0 chmod 644


Replace the 644 with your desired permissions.

chmod on directories only

If you want to chmod all directories in current directory and
all subdirectories enter:

find . -type d -exec chmod 755 {} \;


or

find . -type d -print0 | xargs -0 chmod 755


Replace 755 with your desired permissions.