For years I have been frustrated and I wanted to find a proper way of sorting my pictures. I had photos coming from several devices, and made manual copies on my laptop and on my external hard drive. I ended up with tons of folders and a lot of duplicates. Back then, I only used Ubuntu and its default photo manager .It was pretty handy, but images of my travels were mixed with my casual smartphone pictures. The worst part was the fact that all my pictures were stored on a single folder per date. Then, I started to used Mac with its integrated tool . Like Shotwell, the software is great, especially if you have Apple devices but everything is stored under one giant archive. Shotwell Photos photoslibrary Based on all these observations, I started to look for a simple and universal way to sort all my previous and future pictures. Requirements The solution should: Work on different OS, Linux, OSX, (Windows) Be viewer agnostic, i.e. i should be able to see my photos sorted directly in a folder using Nautilus or Finder Accept all devices and image formats Require few manual intervention Be reproducible: if I sort my gallery again, I should get the same result Solution In order to achieve that, I used a which is a “platform-independent Perl library plus a command-line application for reading, writing and editing meta information in a wide variety of files”. ExifTool To sort my pictures, I am using the following metadata: Custom tag to separate dedicated photo sessions, e.g. a trip in Italy The camera name and model The date The type of file Installation See ExifTool page documentation Workflow Tag events Firstly, I wanted to highlight specific events such as a trip abroad and at the same time be sure that my sorting was reproducible. To do that, I had to add a metadata information at the photo level. When you look at the metadata stored in Exchangeable image file format (Exif) there are tens of attributes. By default the field is not filled, therefore I used this attribute to store my event: UserComment You can write/overwrite the field via exiftool. By convenience I have incorporated that into a bash script: UserComment DEFAULTIMPORTED=/tmp/Images/0_Imported/ TRAVEL= [ -eq 1 ]; IMPORTED= exiftool -UserComment= -overwrite_original [ -eq 2 ]; IMPORTED= exiftool -UserComment= -overwrite_original #!/bin/bash ## PATH TO MY IMAGES DIRECTORY ## #Images to be imported ## USER COMMENT AS A PARAMETER# $1 ## METADATA WRITING ## if $# then $DEFAULTIMPORTED $TRAVEL $IMPORTED elif $# then $2 $TRAVEL $IMPORTED else echo "USAGE: sh tagImportedImages.sh USERCOMMENT [DIRECTORY]" fi You can verify the field as follow: UserComment Sort Once all specific events are filled at the photo level, I can sort all my images using Exiftool again. I have decided to use the following logic, but feel free to change it to your convenience: Here is the script corresponding to the rules above: IMPORTED=/tmp/Images/0_Imported/ GALLERY=/tmp/Images/1_Gallery/ exiftool -d -r \ \ \ \ find - d -empty -delete -mindepth 1 #!/bin/bash ## PATH TO MY IMAGES DIRECTORY ## #Images to be imported #Gallery folder ## SORTING IMAGE COMMAND ## $GALLERY "%Y/" $IMPORTED '-Directory<${FileModifyDate}IMAGES' '-Directory<${CreateDate}${FileType}' '-Directory<${datetimeoriginal}${make}-${model;}_ALL' '-Directory<${datetimeoriginal}${make}-${model;}_${UserComment}' ## DELETE REMANING EMPTY FOLDERS ## $IMPORTED type Exiftoll command details: -d: used to indicate that we will sort the images by date. Here we have chosen one folder per year %Y. You can easily decide to have one folder per month using %Y%M or %Y/%M. $GALLERY”%Y/: destination of the images $IMPORTED: sources of the images -r: means that the sorting will be effective recursively on your target folder and all the associated subfolders The script presented above will sort all the images in the IMPORTED folder and move them to the GALLERY folder. If you try to import images already present in the GALLERY, they will stay in the IMPORTED folder. This means that all remaining images in GALLERY are duplicates based on the UserComment, and camera, and date and filename. With the option -o you can sort all the images in the IMPORTED folder and copy them to the GALLERY folder. Recap Exiftool offers the possibility to consistently sort all my pictures coming from several devices on all the platforms. The tool is also very flexible and quick. It took 20 minutes to sort 50 GB of photos. Now, I can view all my photos directly in the default file manager or via gallery softwares that are reusing the folder structure such as gThumb or Luminar. ) (Featured Image by Vladyslav Dukhin from Pexels