find无法找到linux系统里所有setuid权限的文件
命令:find / -perm -4000 -o -perm > setuid.log
脚本:
#!/bin/bash
find / -perm -4000 -o -perm -2000 > /tmp/setuid.check
for i in $(cat /tmp/setuid.check)
do
grep $i /root/setuid.log > /dev/null
if [ "$?" != "0" ]
then
echo "$i isn't in setuid.log!" >> /root/setuid_log_$(date +%F)
fi
done
rm -rf /tmp/setuid.check
输出报错日志:
/usr/libexec/utempter/utempter isn't in setuid.log!
/usr/bin/wall isn't in setuid.log!
/usr/bin/write isn't in setuid.log!
/usr/sbin/postdrop isn't in setuid.log!
/usr/sbin/postqueue isn't in setuid.log!
/sbin/netreport isn't in setuid.log!
请问各位大大,为什么我用find命令在前面没有找到这些文件,而后面脚本运行的时候会把这些文件找到呢?