Hello Gurus,
I am facing one issue to get a file for a specific time. There are about 300 files created between 6.30 pm to 7.15 pm everyday.
Now I wanted only the file which is created on 6.45pm. No other files required.
I have used "find" command to get the files, but not getting the expected result.
Please advice on this.
Thanks-
Pokhraj
Here's an option, assuming there's no spaces in the file names:
find . -type f -mtime -1 -printf '%f %TH%TM\n' | awk '$NF=="1845" {print $1}'
Thanks.. It is working....
Thanks-
Pokhraj
---------- Post updated at 11:45 AM ---------- Previous update was at 10:38 AM ----------
Hello Gurus,
Also one more confusion.
If I wanted to get a file a time range between 6:45 pm to 7:15 pm, then how can I achieve the same?
Thanks-
Pokhraj
Try a > && < instead of == in the awk statement.