Skip to content
Marcelo Trindade edited this page Jun 29, 2025 · 5 revisions

Welcome to the File Renamer & Snowflake Decoder Wiki

This project provides a set of powerful Bash scripts designed to organize and ensure the uniqueness of media files (images, videos, etc.) by renaming them with a structured, information-rich filename. This new filename acts as a custom "snowflake-like" identifier, containing data about the file’s origin and when it was processed.

A companion script is also provided to easily decode these filenames back into human-readable information.

Core Components

  1. rename_files.sh: The main script that recursively finds media files in a directory and renames them. It intelligently extracts the creation date from EXIF metadata and generates a unique ID to prevent filename collisions.

  2. decode_snowflake.sh: A utility script that takes a renamed file and displays its constituent parts in a clear, formatted way, explaining what each part of the "snowflake" ID means.

Key Features

  • Information-Rich Filenames: Filenames aren’t just random strings; they contain the file’s creation date, a process timestamp, and a unique identifier.

  • Traceability: Know exactly when a file was processed and by what identifier.

  • Uniqueness: A combination of a timestamp and a random number virtually eliminates the chance of duplicate filenames, even when processing files in bulk.

  • Idempotent: The script is safe to run multiple times in the same directory. It automatically detects and skips files that have already been renamed.

  • Intelligent Date Detection: Prioritizes the original creation date from EXIF data (DateTimeOriginal) and gracefully falls back to the file’s modification time if EXIF data is not available.

  • Easy Verification: Use the decode_snowflake.sh script to instantly verify the information embedded in any filename.

Clone this wiki locally