[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

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



On Thu, 2005-07-21 at 15:39, 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.



Mark,

This is not fancy but it should work. Test it in a test directory first
:-)


#!/bin/bash
                                                                               
for I in `ls /path/to/directory/`
do chown $I.<group_name> $I
                                                                               
done



-- 
John


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]