[ubuntu-uk] rsync chgrp problem - advice, please?

Neil Greenwood neil.greenwood.lug at gmail.com
Fri Jun 8 11:02:01 BST 2007


On 08/06/07, luxxius <luxxius at googlemail.com> wrote:
>     I see now why the Ubuntu default is 755 (all the digits odd) -
> everyone can, for starters, see the directories and their contents.

I think the default for directories is 755, the default for files
should be 644. The default is set using the umask command, in case you
wanted to know.

>     So it wasn't that I got mixed up by using the octal method for
> permissions (pace, Robert!);  rather, I just didn't know enough about
> how permissions work.  In fact, like you Neil, I find the octal system
> simpler and neater to use for ordinary purposes: u/g/o maps to the digit
> positions, and their values map the rwx settings as 4/2/1 - easy-peasy
> (especially if you're fairly comfortable with maths!).  But perhaps
> there's some other reason (maybe to do with administering servers?) for
> using the letter notation?

I guess that the reason for the alternative is that some people can't
cope with the octal notation (or maybe the octal notation was added as
a shortcut later), but the chmod command is ancient (at least 25
years), so I'm not sure.

>     I do have one remaining question.  In the following compound command
>
> find ~/music -type f -group diana -exec sudo chgrp root {} \; -exec
> sudo chmod 755 {} \;
>
> what is the function of ' {} \; '?
>
>     I've gleaned that the last term is an escaped semi-colon. I guess
> this indicates the end of a specific group of commands;  and the
> semi-colon has to be escaped to show that it's a delimiter, rather than
> just the sign that the commands continue on the next line without a
> break?  But is the syntax more complex - maybe command sequences
> delimited by  -exec...\;  show that they all act on the output of the
> first command in the line (in this case, 'find ~/music -type f -group
> diana')?  As you see, I'm just guessing here - I'd be interested to
> understand what the syntax really is.

Robert answered this rather well, and more succinctly than I would have :-)

The only point to note is that -exec is part of the find command, so
you can't use it with other ways of getting a list of files.


Hwyl,
Neil.



More information about the ubuntu-uk mailing list