Thursday, May 14, 2009

Script to delete the users that starts with ex and wm

mkdir $HOME/userdel
grep -e wm -e ex /etc/passwd > $HOME/userdel/userdel.tmp
cut -f 1 -d: $HOME/userdel/userdel.tmp > $HOME/userdel/userde2.tmp
for i in `cat $HOME/userdel/userde2.tmp`
do
userdel -r $i
done
rm -rf $HOME/userdel


//Lin u X u niL

No comments:

Post a Comment

tag ur valuable ideas below