UID, GID, and all that

Andrew Heagle andrew-vUgxaBqSMS7QT0dZR+AlfA at public.gmane.org
Mon Aug 20 21:16:46 UTC 2012


A little late, but whatever

You can do this:
chown --from=joe:1002 -R joe:joe /path

This would only change file ownerships that match the --from. Throw in a -v
to log the changes if you like.

Andrew

On Sat, Aug 18, 2012 at 9:50 PM, Peter King <peter.king-H217xnMUJC0sA/PxXw9srA at public.gmane.org> wrote:

> Here's a question I should know the answer to but I'm too jet-lagged to
> think
> of it. I'm rebuilding a system, and I've set up a new boot disk, which
> involved
> creating a new everyday user (call him "joe"). I've mounted the old hard
> disk
> with lots of stuff on it that belonged to joe on the old failed system.
> But now
> while the files are identified as owned by joe as the user, the group id
> is not
> "joe" or "user" but "1002" (no such group). I suppose I could run a massive
> find-and-chgrp command, but I can't be the first person to face this
> problem,
> and there must be a simple solution, which I just can't think of right now.
> Anyone care to tell me the simple and obvious one-line solution? Even two
> lines
> would do. Thanks.
>
> --
> Peter King                              peter.king-H217xnMUJC0sA/PxXw9srA at public.gmane.org
> Department of Philosophy
> 170 St. George Street #521
> The University of Toronto                   (416)-978-4951 ofc
> Toronto, ON  M5R 2M8
>        CANADA
>
> http://individual.utoronto.ca/pking/
>
> =========================================================================
> GPG keyID 0x7587EC42 (2B14 A355 46BC 2A16 D0BC  36F5 1FE6 D32A 7587 EC42)
> gpg --keyserver pgp.mit.edu --recv-keys 7587EC42
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://gtalug.org/pipermail/legacy/attachments/20120820/90d13e67/attachment.html>


More information about the Legacy mailing list