分页: 1 / 1

请问,如何用find找出指定日期的文件,比如找出2004年4月的文件

发表于 : 2008-04-15 2:26
newmcse
请问,如何用find找出指定日期的文件,比如找出2004年4月的文件,比如我写一个script, 输入200405,则找到所有2004年5月的文件?

发表于 : 2008-04-15 9:14
eexpress
touch2个日期的文件
然后用
-cnewer
-anewer
-newer
找中间的。

日期有几种的。自己注意下。

发表于 : 2008-04-15 12:39
newmcse
touch 不是格式要YYYYMMDDhhmm吗?如何光输入YYYYMM呢?

发表于 : 2008-04-21 11:05
bubbi
ls -al |grep 200405 不行吗?
newbie

发表于 : 2008-04-22 17:35
bones7456
newmcse 写了:touch 不是格式要YYYYMMDDhhmm吗?如何光输入YYYYMM呢?
touch要的是 [[CC]YY]MMDDhhmm[.SS] ,其他的用0代替嘛

发表于 : 2008-04-27 21:08
justlook
#!/bin/bash
read -p "input u date(use format:YYYY-MM-DD) " a
echo "u choose $a"
read -p "input the path which u look for" path


find $path -name "*" -type f|xargs -I @ ls -l @>temp
awk -v var=$a '{if($6==var)print $6" "$8}' temp

exit 0