@gogoigo If you like
exiftool, there is much more you can do with it. E.g.:
exiftool -b -JpgFromRaw -w _JFR.JPG -ext NEF -r .
Recursively extract JPG image from all Nikon NEF files in the current directory, adding _JFR.JPG for the name of the output JPG files.
exiftool -a -b -W %d%f_%t%-c.%s -preview:all dir
Extract all types of preview images (ThumbnailImage, PreviewImage, JpgFromRaw, etc.) from files in directory “dir”, adding the tag name to the output preview image file names.
dcraw -e does in fact extract an embedded image, just not one that you may want.
exiftool -a -b -W %d%f_%t%-c.%s -preview:all dir from above. It may extract multiple embedded images. In my case, there are two resultant files: one with
_PreviewImage appended to the filename and the other with
dcraw -e only extracts the former.
The appended labels are actually tags; so if you prefer the
_ThumbnailImage embeds, try doing
exiftool -b -ThumbnailImage -w _JFR.JPG -ext NEF -r .. Notice how I replaced -JpgFromRaw.
exiv2 is an alternative to
exiftool if you would like to explore more options.
PPS I forgot to mention that not all embedded images are necessarily JPG files! So make sure that you remember to change the file naming to reflect the file type.