批量删除用户
#!/bin/bash
aa=`cat /etc/passwd| grep "/bin/bash"|grep -v "root"|cut -d ":" -f1`
for i in $aa
do
userdel -r $i
done
批量添加用户
#!/bin/bash
i=1
while [ $i -le 20 ]
do
useradd stu$i
echo "123456" | passwd --stdinstu$i &> /dev/null
i=`expr $i + 1`
done