Filename Cleanup Planner

Preview how filenames with spaces, brackets, and mixed case can be renamed into web-server-safe names.

Filename Cleanup Plan

Paste multiple filenames to generate safe rename candidates. It does not modify real files.

Enter one filename per line to preview new names.

Related articles

Rename Examples for Mixed Input Formats

These examples show how numbering and extensions are normalized when inputs contain paths, spaces, and uppercase letters.

Four-file preview

Example
IMG 001.JPG summer/photo 02.png download (3).webp Photo.JPG
Result
image-001.jpg image-002.png image-003.webp image-004.jpg

The summer/ path on the second line is stripped; only the final filename and extension are used.

Non-ASCII prefix fallback

Example
prefix 여행 · start 8
Result
file-008.jpg

The current rule allows ASCII letters and numbers in generated prefixes. This limitation is now stated explicitly.

Why not just run mv

A bulk rename destroys the original names the moment it runs. One wrong rule tangles hundreds of files with no way back. So the order is always the same - check the plan, back up, then execute.

Step 1 - Check the plan with the tool above

Paste file names into the box above and a before → after table appears instantly. Each candidate combines the sanitized prefix, a unique sequence number and the original extension. If an input includes a path, only its final filename is used. No actual files are touched.

Step 2 - Backup is one line

Copy the whole folder first and you can always undo.

cp -r ~/photos ~/photos_backup   # full copy (change the path)

Step 3 - Preview run, then the real one

The script below does not rename anything - it only prints the commands it would run. Review the output, then delete the # on the last mv line and run it again for real.

cd ~/photos
n=1
for f in *.jpg; do
    printf -v num '%03d' "$n"        # 001, 002... zero-padded
    new="${num}-trip.jpg"
    echo mv "$f" "$new"              # preview only for now
    # mv "$f" "$new"                 # verified? remove # and rerun
    n=$((n+1))
done

Three common mistakes