User Tools

Site Tools


linux:check_duplicate_uids.sh

check_duplicate_UIDs.sh

#!/bin/bash
cat /etc/passwd | cut -f3 -d":" | sort -n | uniq -c | while read x ; do
 [ -z "${x}" ] && break
 set - $x
 if [ $1 -gt 1 ]; then
 users=`awk -F: '($3 == n) { print $1 }' n=$2 /etc/passwd | xargs`
 echo "Duplicate UID ($2): ${users}"
 fi
done
linux/check_duplicate_uids.sh.txt · Last modified: by andrew

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki