Searching for a files based on current date directory

Hi All,

I've been trying to do some recursive searching but not been very successful. Can someone please help.
Scenario:
I have directory structure

/dir1/dir2/dir3/
2019/
11/
17
18
19
20

so what I want to do is run a script and as its 2019/11/18/ today it would go and only search on that folder and give me number of files init and tomorrow it would search in 2019/11/19/

How about

echo /dir1/dir2/dir3/$(date +"%Y/%m/%d")/init* | wc -w 
1 Like

@RudiC Thanks for the reply. that's what I used, I scripted it something like:

#!/bin/bash
now=$(date)
list_dir=$(date +'%Y/%m/%d')
echo /dir1/dir2/dir3/${list_dir}

and output = /dir1/dir2/dir3/2019/11/19/[/CODE]

The idea was to run this and get me the time of how often a file is put in that directory so I can measure latency. So I have files in there and running my script I get a time return of the last file in the /dir1/dir2/dir3/2019/11/19/ location

2019-11-19+11:36:40.7135938570

How can I do a time diff between above output and systime and then depending on difference it shows me different messages.

You don't say what system you are running this on. Assuming a Linux system and/or Gnu Date you could use something like: