(Answer) (Category) Products of Aardvarks With Chisels : (Category) Linux : (Category) Handy shell scripts :
findunusedUID
#!/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
[Append to This Answer]
2000-Aug-07 11:12pm
Previous: (Answer) keepprocalive
This document is: http://www.cloudmaster.com/~sauer/projects/index.cgi?file=97
[Search] [Appearance]
This is a Faq-O-Matic 2.719.
This FAQ administered by sauer@cloudmaster.com