Your command changes the permissions in all entries ending in *.php
in your working directory, and if you happen to have a directory where the name ends in .php
, it would also go recursively into this directory. However, if you really have a directory named, say, xx.php, your chmod would remove the x-bit, and it would not be possible anymore to cd
into this directory after this chmod
. This is explained in detail here.
For changing only the files ending in .php, which are in the directory tree below some base directory, do a
find /path/to/basedir -name '*.php' -type f -exec chmod -v 0644 {} +
find
is by its nature recursive, and -type f
ensures that you leave directories unharmed.