[K12OSN] Linux Directory Permissions -- Help me clean up my mess

Dan Young dan_young at parkrose.k12.or.us
Thu Jul 21 20:21:48 UTC 2005


Mark Cockrell wrote:
> Hello all,
>    I accidentally changed the permissions of all the directories in
> /home to be owned by "root."  can someone tell me how to change the
> "owner" back to the individual user.  Perhaps a bash script (which I
> know nothing about) that will scan /home and change the the owner to the
> name of the directory?  Example:  directory aabrown should be owned by
> aabrown.  Any help would be appreciated.

$ cd /home
$ for each in *; do chown -R $each $each; done

Salt to taste!

-- 
Dan Young <dan_young at parkrose.k12.or.us>
Parkrose School District




More information about the K12OSN mailing list