to change all directory/sub

The answer above is correct, in that chmod -R 755 will set this as permissions to all files and folders in the tree. BUT WHY ON EARTH WOULD YOU WANT TO? it might make sense for the directories, but why set the execute bit on all the files?

i suspect what you really want to do is set the directories to 755 and either leave the files alone or set them to 644 for this you can use the find command e.g.

to change all the directories to 755:

    find /opt/lampp/htdocs -type d -exec chmod 755 {} \;

to change all the files to 644: find /opt/lampp/htdocs -type f -exec chmod 644 {} \;



Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s