0
点赞
收藏
分享

微信扫一扫

将 Linux 系统中 UID 大于等于 1000 的普通用户都删除shell脚本


脚本样例(delete_user.sh )

[root@rhel77 ~]# cat delete_user.sh 
#!/bin/bash
user=$(awk -F: '$3>=1000{print $1}' /etc/passwd)
echo $user
for i in $user
do
  userdel -r $i
done

举报

相关推荐

0 条评论