Skip to content

Instantly share code, notes, and snippets.

@cnicolai
Created August 1, 2024 12:54
Show Gist options
  • Save cnicolai/0b2e61bd90f098f01825d12db9e34d96 to your computer and use it in GitHub Desktop.
Save cnicolai/0b2e61bd90f098f01825d12db9e34d96 to your computer and use it in GitHub Desktop.
for file in *.MOV; do
date=$(ffprobe -v quiet -show_entries format_tags=creation_time -of default=nw=1:nk=1 "$file" | cut -d'T' -f1)
count=1
while [ -e "$date.MOV" ]; do
date="$date"_"$count"
count=$((count+1))
done
mv "$file" "$date.MOV"
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment