Asked • 06/05/19

How do I change permissions for a folder and all of its subfolders and files in one step in Linux?

I would like to change permissions of a folder and all its sub folders and files in one step (command) in Linux. I have already tried the below command but it works only for the mentioned folder: chmod 775 /opt/lampp/htdocs Is there a way to set `chmod 755` for `/opt/lampp/htdocs` and all of its content including subfolders and files? Also, in the future, if I create a new folder or file inside `htdocs`, how can the permissions of that automatically be set to `755`? I had a look at this link too: http://stackoverflow.com/questions/3740187/how-to-set-default-chmod-in-linux-terminal Thanks in advance. [1]: http://stackoverflow.com/questions/3740187/how-to-set-default-chmod-in-linux-terminal

1 Expert Answer

By:

Richard H. answered • 01/24/20

Tutor
New to Wyzant

Senior Linux Systems Engineer with Red Hat certification.

Still looking for help? Get the right answer, fast.

Ask a question for free

Get a free answer to a quick problem.
Most questions answered within 4 hours.

OR

Find an Online Tutor Now

Choose an expert and meet online. No packages or subscriptions, pay only for the time you need.