Quantcast
Channel: UNIX and Linux Forums
Viewing all articles
Browse latest Browse all 16232

find -ctime

$
0
0
Code:

startdate="2012_07_04-16:14:4"
path1="/home/drdos/sample"

days=0

find $path1 -name "*$startdate*" > teste.txt

while [ ${cat teste.txt | grep -c $startdate } -lt 0]
do

    find $path1 -name "*.zip" ctime $days > teste.txt
    days=`expr $days + 1`
done

echo " Files that are near the string u search are on  teste.txt"

Hi to everyone, i have one question why i get 0 results if i define the variable $startdate="2012_07_04-16:14:45", and if i define it like this $startdate="2012_07_04-16:14:4", he returns the last modified file closer to that search on the dir ?


Thanks in advance

Viewing all articles
Browse latest Browse all 16232

Trending Articles