Mailinglist Archive: opensuse (3441 mails)

< Previous Next >
Re: [opensuse] Correct Way to Recursively Change Permissions
  • From: David Haller <opensuse@xxxxxxxxxx>
  • Date: Thu, 15 Jan 2009 01:52:09 +0100
  • Message-id: <20090115005209.GB6736@xxxxxxxxxxxxxxxxxx>
Hello,

On Wed, 14 Jan 2009, Henare Degan wrote:
I want to change permissions on a large directory structure to only RW
for the owner of all the files. If I:

chmod -R 600 /path/of/directory

it won't work because it removes the 'x' bit from the directory, which
prevents traversal. The only solution I've come up with is to:

chmod -R 700 /path/to/directory

and then:

chmod 600 `find /path/to/directory -type f`

Which seems like a round-about way to achieve this (and needs some
hackery it you have messy file names, like ones with '-' in the path),
what's the "correct" way?

The command

chmod -R u=rwX,go= /path/to/directory

should do exactly what you want.

HTH,
-dnh

--
In /etc is what you think. In /proc is, what the OS thinks.
-- Thomas Blum in doc
--
To unsubscribe, e-mail: opensuse+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: opensuse+help@xxxxxxxxxxxx

< Previous Next >
Follow Ups
References