Skip to main content
This example renames every photo to a padded sequential number while preserving the original subfolder hierarchy. Photo-cli orders files within each folder by their EXIF taken date before assigning numbers, so the sequence always reflects chronological order rather than the original file names.

Command

Key arguments

Before and after

Before (photos/):
After (organized-albums/):

What you see in the output

Numbers are scoped per folder. The root level has only two photos (DSC_5727.jpg and GOPR6742.jpg), so they become 1.jpg and 2.jpg with no leading zero. The Italy album folder has 12 photos, so photo-cli pads to two digits: 01.jpg through 12.jpg. The Spain Journey folder has three photos, producing 1.jpg, 2.jpg, and 3.jpg. Photo-cli also writes a photo-cli-report.csv file at the root of the output folder. This CSV maps every original file path to its new path so you can trace back any numbered file to its source.
Sequential numbering is a good choice when you want to anonymize a batch of photos before sharing them or when you need a simple, predictable sort order in software that orders files alphabetically. Because numbers are assigned by taken date, the sequence is always chronological even if the original file names were not.