Recipes
Copy-and-adapt setups for jobs people ask about most often.
Empty a phone dump into Year/Month folders#
tsoqna sort ~/Downloads/phone-dump --into ~/Photos --folders "{Y}/{Y}-{m}" -n
Drop the -n when the plan looks right. Live-photo pairs (.HEIC + .MOV) share a stem and stay together.
Rename in place, keep the old name as a hint#
tsoqna rename ~/Pictures/scans --pattern "{date}_{orig|lower}{ext}"
Useful when the original name carries meaning, such as a scanner’s frame number.
Keep RAW and JPEG apart#
tsoqna sort /Volumes/CARD --into ~/Photos/raw --include "*.raf" "*.dng" "*.cr3" "*.nef" "*.arw"
tsoqna sort /Volumes/CARD --into ~/Photos/jpeg --include "*.jpg" "*.heic"
One folder per camera#
tsoqna sort ~/inbox --into ~/Photos --folders "{model|slug?unknown}/{Y}"
Fix a camera that was an hour behind#
Forgot to change the clock when the clocks changed? Shift every capture time before naming (since 1.3):
tsoqna rename ~/Pictures/october --shift +1h -n
For an odd offset, find a photo of something with a known time — a station clock, a phone screen — and use the difference: --shift -00:07:30. The shift only changes the names tsoqna produces; the files’ metadata is left as it was.
Photos from a trip abroad#
Most cameras store local time with no time zone. If you want names in the time zone where the photos were taken, say so:
tsoqna rename ~/Pictures/lisbon --tz Europe/Lisbon
Phones usually record the offset themselves, in which case --tz is ignored for those files.
Screenshots and edits without metadata#
tsoqna sort ~/Desktop --into ~/Pictures/screens --include "*.png" --fallback mtime
--fallback mtime uses the file’s modification time when there is no capture date. It is reported as (from mtime) in the plan so you can tell which names are guesses.
Copy from a card instead of moving#
tsoqna sort /Volumes/CARD --into ~/Photos --copy
With --copy, files are copied and verified by size and checksum before tsoqna moves on. The card is left exactly as it was, and no journal is written because there is nothing to undo.
A folder that always sorts the same way#
Put a .tsoqna.toml in your inbox folder and you never need to type the flags again:
# ~/inbox/.tsoqna.toml
folders = "{Y}/{Y}-{m}"
pattern = "{date}_{time}{seq|pad:2?}{ext}"
fallback = "mtime"
tsoqna sort ~/inbox --into ~/Photos