Find commonality/pattern in a bunch of files

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 Example: 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 […]