bash - Need to find files modified between 15 and 5 minutes ago -
i'm trying find files in given folder modified withing time frame, between 5 , 15 minutes ago.
currently can find modified 15 minutes ago using find -cmin
#!/bin/bash  minutes="15"  filetypes=`find . *pattern*.txt* -maxdepth 0 -type f -cmin -$minutes`   how give time frame?
try :
find . -name '*pattern.txt' -maxdepth 1 -type f \( -mmin -15 -a -mmin +5 \)   notes
- the parenthesis not mandatory here and : 
-a, it's necessary case or:-o - always use single quotes around pattern prevent shell expansion of wildcard
 - to give pattern, use 
-nameor-iname - for date/hour, 
-mminway go minutes ,-mtimedays. 
Comments
Post a Comment