Let's say, I have a folder with hundreds or thousands of files, all named after the following schema:
<random number of variable length>_<date code in YYYYMMDD format>.jpg
73923_20180927.jpg 4457582_20180927.jpg ... 18733557_20190401.jpg 23573_20190401.jpg ...
What I expect my bash script to do, is printing a list of those date codes, i.e.
20180927 20190401 ...
That sounds like an easier task that it is. Since the schema is always the same, I already achieved to apply string manipulation in order to only print the required part of the file names. However, I'm still figuring out, how to print each date only once.
Is there a neat way out of this?