Copy permissions from owner

1

How can I copy the all file permissions of a folder from owner to users?

Imagine that I have:

-rw-r-----  1 124982 5000   201 2012-06-24 06:45 documentation.html

I want to change to:

-rw-r--r--  1 124982 5000   201 2012-06-24 06:45 documentation.html

Victor

Posted 2012-10-25T12:03:28.347

Reputation: 127

Answers

1

That would be either

chmod 0644 documentation.html

or you can do

chmod a+r documentation.html

To change modes recursively on a folder (i.e for each file in a folder), do:

chmod -R <mode> <path>

But be careful - this changes directory modes as well, which differ from file mode in their use of the "execute" permission.

Xyon

Posted 2012-10-25T12:03:28.347

Reputation: 1 499

Yes, but how can I get the values of rwx from ownser and set to all? – Victor – 2012-10-25T12:13:36.417

From what? What is owner in this context? – Xyon – 2012-10-25T12:16:45.757