User Tools

Site Tools


linux:check_duplicate_users.sh

check_duplicate_users.sh

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

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki