Skip to content

Instantly share code, notes, and snippets.

View jfautley's full-sized avatar

Jon Fautley jfautley

View GitHub Profile
@jfautley
jfautley / gist:3945009
Created October 24, 2012 09:13 — forked from mdengler/gist:3944990
fixperms.sh
awk -F: '($3 >= 1000) { printf("%s:%s:%s:%s\n", $1, $3, $4, $6) }' /etc/passwd | while read line; do
UNAME=$(echo $line | cut -d: -f1)
USERID=$(echo $line | cut -d: -f2)
GRPID=$(echo $line | cut -d: -f3)
HMDIR=$(echo $line | cut -d: -f4)
echo "Changing user [$UNAME] with home [$HMDIR] to [$USERID:$GRPID]"
#chown -R $USERID:$GRPID $HMDIR
done