Bash Script: Changing file permissions recursively

Viewed 1464

I need a Bash script that changes the file permissions of all files in a directory and all subdirectories. It should behave like this:

for each file in directory (and subdirectories)
   if i am the owner of the file
      if it is a directory
         chmod 770 file
      else
         chmod 660 file

I guess it's not a difficult task but I am not very experienced in Bash scripts. Your help is appreciated! :D

3 Answers
Related