I am moving a website from one server to another and Git does not store metadata such as file permissions. I need to find the directories and files that are not 775 / 664 respectively.
Right now, I'm using this cobbled-together contraption:
$ find . -type d -exec ls -la {} \; | grep ^d | grep -v ^drwxrwxr-x
$ find . -type f -exec ls -la {} \; | grep -v ^d | grep -v ^-rw-rw-r-- | grep -v '.git'
Though this works, I feel it is rather hacky. Is there a better way to do this, perhaps a canonical way, or should I just be hacky?
This is running on a recent Ubuntu version with GNU tools under Bash.