[CentOS] Changing UID numbers

Tony Mountifield tony at softins.co.uk
Thu Feb 21 10:30:32 UTC 2019


In article <2f86eabc-697f-4f57-3a0a-f2e5da13d9d7 at nist.gov>,
Chris Schanzle via CentOS <centos at centos.org> wrote:
> My guess is you used something like
> 
>    find -uid=500 -exec chown 1000 {} \;
> 
> This will start a chown process for each file, changing only one file at a time.  That's a lot of work the system has
> to do for each file!  But you probably know chown (and similar utilities) can take multiple file arguments, and 'find'
> can help you take advantage grouping many arguments with the '+' operator to -exec:
> 
>    find -uid=500 -exec chown 1000 {} +

Well I never knew that! Thanks. For many years I have been doing: find ... -print0 | xargs -0 ...

Ah, I see the newer syntax was introduced in CentOS 5. :-)

Cheers
Tony

-- 
Tony Mountifield
Work: tony at softins.co.uk - http://www.softins.co.uk
Play: tony at mountifield.org - http://tony.mountifield.org


More information about the CentOS mailing list