[clug] Syncronising UID/GIDs when migrating to LDAP

Sam Couter sam at couter.id.au
Thu Sep 13 10:46:18 GMT 2007


Michael James <clug3 at james.st> wrote:
> Years ago I migrated a batch by hand using:
> root>  find -name <old-number> -exec chown <new-name> {} \;

Eek! The -exec option to find will execute the program once for each
file it finds. Much better to use xargs to execute with a whole bunch of
files as arguments. Assuming GNU find and xargs:

find <whatever> -print0 | xargs -0 chown <new-uid>

This will be much faster.
-- 
Sam Couter         |  mailto:sam at couter.id.au
                   |  jabber:sam at teknohaus.dyndns.org
OpenPGP fingerprint:  A46B 9BB5 3148 7BEA 1F05  5BD5 8530 03AE DE89 C75C
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : http://lists.samba.org/archive/linux/attachments/20070913/9922298a/attachment.bin


More information about the linux mailing list