Can I search between file names?

Hi,

I have a large number of files that have in the file name a date stamp such as "091021". Is there a way to search for files where the name falls between dates in the name?

Ex: find . -type f -name "*091001* - *091021*" -exec ls -l {} \;

Something like that.

awk is your friend:.

Eg:

ls <dir> | awk '$0>=from&&$0<=to' from="*091001*" to="*091021*"

or

find . | awk '$0>=from&&$0<=to' from="*091001*" to="*091021*"

HTH

This is not working for me. Keeps going to the next line as if it's not finding anything. Here's what I'm typing:

find . | awk '$0>=from&&$0<=to' from="*090801*" to="*090930*"

I also tried:

find . -type f | awk '$0>=from&&$0<=to' from="*090801*" to="*090930*"

Keeps coming back blank. I can do an ls -l and see files that should be displayed. Am I doing something wrong?