I have a directory /sources and inside it's the .idea directory which belongs to phpStorm projects. The directory /sources is mounted as a VOLUME in a Docker container (~/sources:/var/www). I have a script running at container start which is setting up some permissions as follow:chown -R www-data:www-data /var/www/sources && find /var/www/sources -type d -print0 | xargs -0chmod 2775 && find /var/www/sources -type f -print0 | xargs -0 chmod 0664And those permissions goes also to .idea which is making phpStorm not to have access to the folder and therefore is not able to write there.Could not save project: Unable to save project files. Please ensure  project files are writable and you have permissions to modify them.I have read some posts:https://stackoverflow.com/questions/4210042/exclude-directory-from-find-commandhttps://stackoverflow.com/questions/2065447/how-do-i-exclude-a-folder-when-performing-file-operations-i-e-cp-mv-rm-and-chhttps://stackoverflow.com/questions/1163294/changing-chmod-for-files-but-not-directoriesBut the solution is slight different from mine. How do I skip the .idea directory using the statement above?
How to skip a directory when I am setting up permissions using find?
linux;permissions;find
If you want to exclude the directory /var/www/sources/.idea and everything in it:find /var/www/sources -type d -not -path '/var/www/sources/.idea*' -exec chmod 0755 {} +find /var/www/sources -type f -not -path '/var/www/sources/.idea*' -exec chmod 0644 {} +