IDependOn-Set: 1 IDependOn-Set: 3 IDependOn-Set: 66 IDependOn-Set: 96 IDependOn-Set: 97 LastModifiedSecs: 965707942 Parent: 66 SequenceNumber: 3 Title: findunusedUID Part: 0 Author-Set: sauer@cloudmaster.com HideAttributions: 1 LastModifiedSecs: 965707934 Type: Lines: 12 #!/bin/bash # A quick script to search through /etc/passwd and find all the UID's # that are not listed as the owner of any files on a system. It's # ugly, and does things in a slow, ungainly way - but it does work... :) # for ID in `cat /etc/passwd | cut -d':' -f 3 | sort -n`; do files=`find / -uid $ID 2>/dev/null` if [ -z "$files" ]; then U=`perl -e"print '', (getpwuid($ID))[0]"` echo "$U (UID $ID) owns no files" fi done EndPart: 0