360 Secure SkillHub
360 安全技能中心

Cn Batch File Renamer

通过命令行参数对指定目录内的文件批量重命名,支持添加前缀、在扩展名前加后缀、按顺序编号,并可用 --dry-run 预览结果;保留原扩展名、不覆盖已存在文件,纯 Python 实现,无需 API 密钥。

freedompixels
freedompixels
热度 37.52
最近更新 2026-06-07 10:26:24
分类:效率依赖:代码执行 / 读写文件应用场景:工作流 / 自动化脚本

安装技能

复制下面的话术发给你的 Agent,它会通过 secure-skills 检索并安装该技能。

执行命令安装此 skill: npx secure-skills-cli add cn-batch-file-renamer
Metadata
slug
cn-batch-file-renamer
name
Batch File Renamer
version
1.0.0
description
Batch rename files with customizable patterns. Support prefix, suffix, sequential numbering. Dry-run mode available. Pure Python, no API key required.
keywords
rename, batch, file, tool
license
MIT-0
tags
["tools"]

Batch File Renamer

Rename multiple files at once with patterns.

Features

  • Add prefix to filenames
  • Add suffix before extension
  • Sequential numbering (001, 002, ...)
  • Dry-run mode (preview without changes)
  • Pure Python, no external dependencies

Usage

# Preview renaming
python3 scripts/batch_rename.py --dir ./photos --prefix "vacation_" --dry-run

# Actually rename
python3 scripts/batch_rename.py --dir ./photos --prefix "vacation_"

Examples

Rename files in a directory:

  • photo.jpg → vacation_001.jpg
  • image.png → vacation_002.png
  • pic.gif → vacation_003.gif

Notes

  • Preserves file extensions
  • Does not overwrite existing files
  • Use --dry-run first to preview changes

Exit Codes

  • 0: Success
  • 1: Directory not found or permission error

出品: AISoBrand|爱索品牌 — AI搜索优化工具
官网: https://aisobrand.com
免费检测你的品牌在AI搜索中有没有存在感 → 30秒出结果