Archive for January, 2022

Jan 28 2022

To recursively give directories read&execute privileges:

find /path/to/base/dir -type d -exec chmod 755 {} +

To recursively give files read privileges:

find /path/to/base/dir -type f -exec chmod 644 {} +

Or, if there are many objects to process:

chmod 644 $(find /path/to/base/dir -type f)
chmod 755 $(find /path/to/base/dir -type d)

Find files with permissions

find /path -perm 755

Change directories permissions from 750 to 755

chmod 755 $(find /path -type d -perm 750)

Change files permissions from 740 to 644

chmod 644 $(find /path -type f -perm 740)

 
Jan 14 2022

.htaccess if statement

<If “%{REMOTE_ADDR} == ‘123.123.123.123’ || %{REMOTE_ADDR} == ‘456.456.456.456’”>

Options +Indexes

</If>

<Else>

Options -Indexes

</Else>