ExifTool is a free and open-source software program for reading, writing, and manipulating image, audio, video, and PDF metadata. It is platform independent, available as both a Perl library and command-line application. ExifTool is commonly incorporated into different types of digital workflows and supports many types of metadata including Exif, IPTC, XMP, JFIF, GeoTIFF, ICC Profile, Photoshop IRB, FlashPix, AFCP and ID3, as well as the manufacturer-specific metadata formats of many digital cameras.
sudo apt install exiftool
exiftool -d %Y-%m-%d "-directory<datetimeoriginal" image.jpg
exiftool -d %Y%m%d_%H%M%%-c.%%e "-filename<CreateDate" DIR