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

wescott at sc.rr.com wescott at sc.rr.com
Thu Jul 21 20:15:28 UTC 2005


> 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.

Just the directories? Try this (as root)

cd /home
for i in *
do
chown $i $i
done

-- 
    Mike Wescott
    wescott at sc.rr.com





More information about the K12OSN mailing list