0
点赞
收藏
分享

微信扫一扫

shell考试脚本简单案例编写


#!/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


举报

相关推荐

0 条评论