Skip to content
cccskills
FreePublished on GitHub

batch-file-ops

基于 glob 通配符模式的批量文件操作(删除、移动、复制、列表)。用于高效文件系统操作的 CLI 工具。零依赖。

The English summary is being prepared. Showing the original description.

Run score Not tested

See how to install

Files included (1)

  • SKILL.md2.8 KB

SKILL.md (original)

Review the instructions the agent will receive before you install.

<img src="../banner.png" width="100%" alt="batch-file-ops banner">

中文 — batch-file-ops 官方中文版本。

batch_file_ops - 批量文件操作 (中文)

用于使用 glob 通配符模式对文件执行高效批量操作的 CLI 工具。 支持:delete、move、copy、list。零依赖(仅使用 Python 标准库)。


操作

操作说明
delete删除符合模式的文件
move移动符合模式的文件
copy复制符合模式的文件
list列出符合模式的文件

CLI 用法

python batch_file_ops.py <action> <source> [<target>] --pattern "<glob>" [--dry-run] [--recursive]

参数

参数说明
actiondelete、move、copy 或 list
source源目录
target目标目录(仅适用于 move 和 copy)
--pattern, -pGlob 通配符模式(例如 *.py、TOOLS_*.py)- 默认值:*
--dry-run, -n仅预览,不应用实际更改
--recursive, -r在子目录中递归搜索

示例与用法

# 列出目录中的所有 Python 文件
python batch_file_ops.py list /path/to/directory --pattern "*.py"

# 删除所有 .tmp 文件(先使用 dry-run 预览!)
python batch_file_ops.py delete /path/to/directory --pattern "*.tmp" --dry-run
python batch_file_ops.py delete /path/to/directory --pattern "*.tmp"

# 移动文件
python batch_file_ops.py move /source /target --pattern "*.txt"

# 复制文件(递归)
python batch_file_ops.py copy /source /target --pattern "*.md" --recursive

# 模式示例
python batch_file_ops.py delete /path --pattern "TOOLS_*.py"
python batch_file_ops.py list /path --pattern "backup_202?-*"

注意事项

  • 先进行空运行(Dry-run): 在使用 delete 和 move 时,务必先使用 --dry-run 预览
  • Glob 模式: 使用 Python 的 pathlib.glob() / pathlib.rglob()
  • 兼容 Windows: 自动使用 UTF-8 输出编码
  • 仅限文件: 自动跳过目录(仅处理文件)

Reviews

No reviews yet. Tell others what you thought.

Comments

No login needed. Share how it worked for you, ask a question, or note where it did not run.

No comments yet. Be the first to write one.

Comments are published right away. Do not include personal information such as email addresses or phone numbers. Up to 2 URLs.

0 / 1,000 characters

This form is protected by reCAPTCHA, and the Google Privacy Policy and Terms of Service apply.

More skills from this repository

Akademisches Studien- und Fristenmanagement mit Quellenprüfung, Datenschutz und realistischer Handlungsplanung.

The English summary is being prepared. Showing the original description.

ellmos-ai/skills8Updated Oct 23, 2026

Aktives Lernen, Erarbeitung von Fachinhalten und strukturierte Erstellung von Synthesen.

The English summary is being prepared. Showing the original description.

ellmos-ai/skills8Updated Oct 23, 2026

Prüfungsvorbereitung, Selbsttests, Probeklausuren und systematische Fehleranalyse.

The English summary is being prepared. Showing the original description.

ellmos-ai/skills8Updated Oct 23, 2026

Acceptance & Commitment Therapy (ACT) according to Steven Hayes: Hexaflex model with the six core processes of psychological flexibility.

The English summary is being prepared. Showing the original description.

ellmos-ai/skills8Updated Oct 23, 2026

Терапия принятия и ответственности (ACT) Стивенса Хейса: модель Гексафлекс с шестью ключевыми процессами психологической гибкости.

The English summary is being prepared. Showing the original description.

ellmos-ai/skills8Updated Oct 23, 2026

Acceptance & Commitment Therapy (ACT) nach Steven Hayes: Hexaflex-Modell mit den sechs Kernprozessen psychischer Flexibilität.

The English summary is being prepared. Showing the original description.

ellmos-ai/skills8Updated Oct 23, 2026

See all skills by ellmos-ai

Report a problem with this skill