find /usr/ -newermt ‘2017-05-07’ ! -newermt ‘2017-05-08’
在/usr/下查找2017-05-07-2017-05-08的文件
!/bin/bash
for file in /*; do
if [ $file == “/opt” -o $file == “/proc” -o $file == “/run” -o $file == “/s ] ;then
continue
fi
echo ###########$file############
find $file -newermt ‘2017-05-07’ ! -newermt ‘2017-05-08’
echo ###########################
echo
done
本文介绍了一个bash脚本,用于在特定目录下查找指定日期范围内的文件。通过使用find命令结合-newermt选项,该脚本能够高效地筛选出在2017年5月7日至2017年5月8日之间修改的文件。
5289

被折叠的 条评论
为什么被折叠?



