Okay so I have about 100 directories in my home folder each owned by the home user itself. Sometimes I have to manually replace some files as root so the permissions are disturbed and some files are no longer owned by that user. To fix this, I always have to use the following command within the home directory:chown -R user:user user/Now I'm looking at some shortcut because I can't do this for all the 100 users out there.I'm wondering what would be done by:chown -R *:* *
chowning each home user to itself recursively
shell;directory;chown
The full answer would be1) Open a file like  vi chown_homedirs2) Put in the next code#!/bin/bashcd /home &&    for h in *  do     chown -R $h:$h $h;   done3) Save the file4) chmod +x chown_homedirs5) run ./chown_homedirsNOTE: If user directories have spaces in them you always need to quote the expansion. If you don't quote the expansion things might fail and pose you to unexpected results.