Get all the user home dirs on the system - RH

5 views
Skip to first unread message

hq4...@gmail.com

unread,
Mar 7, 2006, 5:13:04 AM3/7/06
to bash tips
<<<
#!/bin/sh

# DESCRIPTION : Get list of home dirs for normal user's on the system.

PASSWD_FILE=/etc/passwd
STARTID=500
ENDID=65500

awk -F: '{if ($3 >= $STARTID && $3 < $ENDID) print $6}' $PASSWD_FILE
>>>


A nice idea would be to to combine it with auto delete script on a time
based period.

Place it in
/usr/local/bin/usershome.sh
and
chmod u+xs /usr/local/bin/usershome.sh

Reply all
Reply to author
Forward
0 new messages