Change ownership of all files owned by "502" to me?

Discussion in 'Mac Basics and Help' started by camfrye, Sep 2, 2010.

  1. camfrye macrumors newbie

    Nov 6, 2008
    I'm putting the pieces back together after a HDD crash and subsequent Time Machine restore and might have gotten things a bit messier than they need to be.

    I created a user called "restore", for the sole purpose of restoring from Time Machine. I then created a new user called camf to use as the main login.

    I have some scripts that run fairly regularly and console shows that they have been unable to run - "permission denied".

    I checked the permissions of the files in question, and sure enough they were owned by "restore". I figured deleting the restore account would revert ownership back to me/camf (the only other administrator). That didn't happen, the files are now owned by 502.


    drwxr-xr-x 8 502 staff 272 28 May 17:18 biz
    drwxr-xr-x@ 9 502 staff 306 25 Mar 22:14 random
    drwxr-xr-x+ 5 502 staff 170 1 Nov 2007 iPhoto
    drwxr-xr-x 3 camf staff 102 17 Aug 22:32 temp
    drwxr-xr-x 2 camf staff 68 24 Aug 10:01 xfolder

    My question:

    Is there a way to globally (across all drives, or even drive by drive) change all files owned by 502 to camf

    FWIW, I'm running 10.6.4

    Any help would be appreciated.

  2. ToastyX macrumors regular

    Oct 4, 2005
    Open Terminal and enter this: sudo find / -user 502 -exec chown camf {} \;

    Then enter your password. This will take a while since it has to check the permissions of every file. If you have any drives mounted, it should affect those too.
  3. camfrye thread starter macrumors newbie

    Nov 6, 2008

Share This Page