#!/bin/bash
最简单的写法一行:
find /usr -not -gid 0 -and \( -type f -and -size -50M -and -size +10M -and -perm -2000 \) -exec cp -a {} /root/myfiles \;
for var_gid in `awk -F ':' '{print $3}' /etc/group`
do
echo GID is $var_gid
if [ $var_gid != 0 ];then
find /usr -size +10k -size -50k -gid ${var_gid} -perm -2000 -exec cp -a {} /root/myfiles \;
fi
done
shell考试脚本简单案例编写
于 2023-02-27 21:07:24 首次发布
![](https://img-home.csdnimg.cn/images/20240711042549.png)