I have a directory that contains txt files with unique times that gets generated overnight. I am trying to list those files given the unique timestamps in the file. Some example of file names are the following:
file_20210122_1130_1.txt file_20210122_1133_1.txt file_20210122_1221_1.txt file_20210122_1342_1.txt file_20210122_1721_1.txt file_20210122_1911_1.txt file_20210122_2009_1.txt file_20210122_2020_1.txt file_20210122_2130_1.txt ...
I want the ability to list the files (using pattern contained in the filename itself) between 1900 and 2100 and it should list the following:
file_20210122_1911_1.txt file_20210122_2009_1.txt file_20210122_2020_1.txt
I am trying to use the below code snippet but it partially works and does NOT list all of the files.
cd /home/somedir/files; ls *.txt | awk '/1900/,/2100/'
Any help would be appreciated.