使用find查找当前目录下比/etc/hosts新的文件,并将查询的结果存储到hosts.new文件

求大哥给下思路。。。。。。。。?。。。。。。。。。。。。。。。。。。。。。。

touch hosts.new
find获取当前目录下所有文件存放在一个二维数组a[0][X]里面
sata循环获取a[0][X]数组里面文件的创建时间戳放在数组a[1][x]里面。获取/etc/hosts时间戳为c;
比较a[1][x]是否大于c,大于c就用echo a[0][x] >> hosts.new;echo "\n" >> hosts.new;

cp -a /etc/hosts . 拷贝hosts文件到当前目录,ls -lrt .把当前目录按时间排序,hosts文件之后的就是比hosts新的文件。

[root@localhost ~]# touch hosts.new
[root@localhost ~]# find . -newer /etc/hosts >>hosts.new
[root@localhost ~]# cat hosts.new