Using self hosted Immich as a google photos alternative for photo backup and consolidation.
recursively find file types
find . -type f -printf '%f\n' | sed 's/^.*\.//' | sort -u
remove spaces in file and directory names
find . -name "* *" \( -type f -o -type d \) -execdir rename -v --all " " "_" "{}" +
remove commas in file and directory names
find . -name "*,*" \( -type f -o -type d \) -execdir rename -v --all "," "" "{}" +
Parse directory recursively for image files and move them to the root directory
for f in $(find . -type f -iname '*JPG' -o -iname '*.PNG' -o -iname '*.jpeg' -o -iname '*.bmp' -o -iname '*.tif'); do mv "$f" ./"$(basename $(dirname "$f"))-$(basename "$f")"; done;
Parse directory recursively for video files and move them to the root directory
for f in $(find . -type f -iname '*.AVI' -o -iname '*.MOV' -o -iname '*.m4v' -o -iname '*.mp4'); do mv "$f" ./"$(basename $(dirname "$f"))-$(basename "$f")"; done;
AVI MOV m4v mp4
combined:
find . -name "* *" \( -type f -o -type d \) -execdir rename -v --all " " "_" "{}" + && \
find . -name "*,*" \( -type f -o -type d \) -execdir rename -v --all "," "" "{}" + && \
for f in $(find . -type f -iname '*JPG' -o -iname '*.PNG' -o -iname '*.jpeg' -o -iname '*.bmp'); do mv "$f" ./"$(basename $(dirname "$f"))-$(basename "$f")"; done;
alias immichup='immich upload --key 4bpl6KHn --server http://192.168.1.48:8322/api'
Exiftool for adding photo dates to metadata. this is used to sort photos on the timeline
exiftool -DateTimeOriginal="2014:12:16 15:15:00" Owen/owen-bruce-21.jpg