Thursday, September 10, 2009

Shell script to chown for specific user

SkyHi @ Thursday, September 10, 2009
#!/bin/bash
IFS="
"

find / -user username >> /tmp.out

for i in `cat /tmp.out`; do
chown username "$i"
done
rm /tmp.out

exit




#find . -user username -exec chown otheruser {} \;
# find . -group apache -exec chgrp root {} \;


#find . -user username -exec chown otheruser {} \;
# find . -perm 775 -type d -exec chmod 775 {} \;
# find . -perm 644 -type f -exec chmod 664 {} \;