Input
...
...
PANO_20190917_185957.jpg
BURST20201216180114905_COVER.jpg
BURST20201214164624071_COVER.jpg
IMG_20190317_112951.jpg
IMG_20190317_112939.jpg
IMG_20190317_112936.jpg
IMG_20190317_112947.jpg
IMG_20200326_013746.jpg
...
...
Sed
$ fd . ./ -t f | sed -E 's/.*\([0-9]\{1,6\}\).*/\1/'
sed: -e expression #1, char 26: invalid reference \1 on `s' command's RHS
Desired Output
...
...
201909
202012
202012
201903
201903
201903
201903
202003
...
...
Any other way to do this? I've been struggling all day trying to get this working...