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

Piping to xargs is a dirty way of doing that which can be done inside of find. find . -type d -exec chmod 0755 {} \; find . -type f -exec chmod 0644 {} \; You can be even more controlling with other options, such as: find . -type d -user harry -exec chown daisy … Read more

changing chmod for files but not directories

A find -exec answer is a good one but it suffers from the usually irrelevant shortcoming that it creates a separate sub-process for every single file. However it’s perfectly functional and will only perform badly when the number of files gets really large. Using xargs will batch up the file names into large groups before … Read more

chmod WSL (Bash) doesn’t work

To enable changing file owners & permissions, you need to edit /etc/wsl.conf and insert the below config options: [automount] options = “metadata” Do this inside the WSL shell, potentially needing sudo to edit/create the file. This may require restarting WSL (such as with wsl –shutdown which is a Windows command, not one within WSL) or … Read more

Correct owner/group/permissions for Apache 2 site files/folders under Mac OS X?

This is the most restrictive and safest way I’ve found, as explained here for hypothetical ~/my/web/root/ directory for your web content: For each parent directory leading to your web root (e.g. ~/my, ~/my/web, ~/my/web/root): chmod go-rwx DIR (nobody other than owner can access content) chmod go+x DIR (to allow “users” including _www to “enter” the … Read more

Python module os.chmod(file, 664) does not change the permission to rw-rw-r– but -w–wx—-

Found this on a different forum If you’re wondering why that leading zero is important, it’s because permissions are set as an octal integer, and Python automagically treats any integer with a leading zero as octal. So os.chmod(“file”, 484) (in decimal) would give the same result. What you are doing is passing 664 which in … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)