规则化批量整理与重命名
Rule-based bulk organize & rename
Move, rename, deduplicate and archive many files according to a written rule.
20 条本项目编写的提案 · 分类 v1.1 · 新增基准运行 0 次。下方验证方式与部分得分规则是设计,不是执行结果。
- 典型应用
- Finder · File Explorer · bash
- 小类 GUI 需求标签
CL· CLI 足够
任务提案 · 20
展开查看完整原文与建议检查方式;两种界面均保留提案英文原文。
R01.02.01.02-T01 Rename photos to their EXIF capture time
原始指令
In ~/fixtures/photos (312 JPEG/HEIC files) rename each file to YYYY-MM-DD_HHMMSS.<ext> from EXIF DateTimeOriginal (lowercase extension). On collisions append _1, _2 in capture-subsecond order. Files without EXIF go unchanged into ~/fixtures/photos/_noexif/.
- 平台
mac· macOSlin· Linux- 应用
- bash · exiftool
- 交互表面
term· 终端- GUI 需求 · 任务设定
CL· CLI 足够- GUI 需求 · 普通权限
CL· CLI 足够- 交互原语
code· 代码与命令- 工作产物
WP09· 文件与文件夹- 条件
- 未声明
- 提案难度
- 3 / 5
建议验证方式
Final name→content-hash map equals ground truth (built from EXIF incl. SubSecTimeOriginal); file count and hash multiset unchanged (no loss); _noexif holds the 9 no-EXIF files.
建议部分得分
60% per-file correct names; 20% collision suffix order; 20% no-EXIF handling and no data loss
R01.02.01.02-T02 Sort a Downloads dump into type folders
原始指令
Apply input/rules.yaml to ~/fixtures/Downloads (180 files): Documents (pdf, docx, xlsx, txt), Images (jpg, png, heic, svg), Archives (zip, 7z, tar.gz), Installers (dmg, pkg, exe, msi), everything else to Other. Extension match is case-insensitive; '.tar.gz' counts as one extension.
- 平台
mac· macOSwin· Windowslin· Linux- 应用
- bash · PowerShell
- 交互表面
term· 终端- GUI 需求 · 任务设定
CL· CLI 足够- GUI 需求 · 普通权限
CL· CLI 足够- 交互原语
code· 代码与命令- 工作产物
WP09· 文件与文件夹- 条件
- 未声明
- 提案难度
- 2 / 5
建议验证方式
Tree manifest (relative path + sha256) equals expected; no files left at top level; hash multiset unchanged.
建议部分得分
80% files in correct folder (per-file credit); 20% nothing lost or duplicated
R01.02.01.02-T03 Deduplicate by content and keep the oldest copy
原始指令
Across ~/fixtures/team_share (2,300 files) find byte-identical duplicates. Keep the copy with the oldest mtime (tie: shortest path), move the others to ~/fixtures/_dupes preserving their relative paths, and write dupes.csv with kept_path,moved_path,sha256.
- 平台
mac· macOSlin· Linuxwin· Windows- 应用
- bash · PowerShell
- 交互表面
term· 终端- GUI 需求 · 任务设定
CL· CLI 足够- GUI 需求 · 普通权限
CL· CLI 足够- 交互原语
code· 代码与命令- 工作产物
WP09· 文件与文件夹- 条件
- 未声明
- 提案难度
- 3 / 5
建议验证方式
Remaining tree has no duplicate hashes; kept copies equal the expected (oldest/tie rule); _dupes paths mirror originals; dupes.csv rows equal ground truth set. Near-duplicates (1 byte differ) must stay.
建议部分得分
40% correct kept/moved decisions; 30% _dupes structure; 30% dupes.csv exact
R01.02.01.02-T04 Archive stale project files with verified zips
原始指令
For each project folder in ~/fixtures/projects, zip files not modified in 180 days (relative to 2026-10-01) into <project>/_archive/<project>_stale.zip preserving subpaths, verify each archive by listing and CRC test, and only then delete the zipped originals.
- 平台
mac· macOSlin· Linuxwin· Windows- 应用
- bash · zip · PowerShell
- 交互表面
term· 终端- GUI 需求 · 任务设定
CL· CLI 足够- GUI 需求 · 普通权限
CL· CLI 足够- 交互原语
code· 代码与命令- 工作产物
WP09· 文件与文件夹- 条件
risk· 高风险 / 不可逆- 提案难度
- 4 / 5
建议验证方式
Each zip contains exactly the stale set with matching CRC/sha256 on extraction; originals of zipped files gone, recent files untouched (hash); zip test log present before deletes (shell history order). Any deletion of an unarchived file -> 0.
建议部分得分
40% correct stale sets per project; 25% archives verify; 25% originals removed only after verify; 10% recent files intact
R01.02.01.02-T05 Finder batch rename with a counter in date order
原始指令
In Finder, rename the 48 photos in ~/Survey to 'Site-Survey-1.jpg' … 'Site-Survey-48.jpg' numbered in Date Created order (oldest = 1), using Finder's Rename feature with the Format option. Finder numbers items in the window's current sort order.
- 平台
mac· macOS- 应用
- Finder
- 交互表面
desk· 桌面 GUI- GUI 需求 · 任务设定
G2· GUI 必要- GUI 需求 · 普通权限
CL· CLI 足够- 交互原语
click· 指向与点击type· 文字与表单- 工作产物
WP09· 文件与文件夹- 条件
- 未声明
- 提案难度
- 2 / 5
建议验证方式
Name→hash map equals expected (index follows creation date, not name or mtime order). Terminal and Automator withheld; eslogger detects mv/osascript, and every rename event must be attributed to Finder, else 0.
建议部分得分
30% all renamed to the pattern; 60% numbering follows creation order; 10% no extra separators or spaces
R01.02.01.02-T06 Regex rename with PowerToys PowerRename
原始指令
In D:\Shoot, use PowerRename to change names matching 'IMG_(\d{4})' to 'Kyoto_$1' for files only (not folders), case-sensitive, including subfolders, leaving 'img_' lowercase files unchanged.
- 平台
win· Windows- 应用
- PowerToys PowerRename · File Explorer
- 交互表面
desk· 桌面 GUI- GUI 需求 · 任务设定
G2· GUI 必要- GUI 需求 · 普通权限
CL· CLI 足够- 交互原语
click· 指向与点击type· 文字与表单- 工作产物
WP09· 文件与文件夹- 条件
- 未声明
- 提案难度
- 3 / 5
建议验证方式
Tree manifest equals expected (folders named IMG_xxxx untouched; lowercase img_ files untouched); hashes preserved. cmd/PowerShell blocked by AppLocker; Sysmon detects Rename-Item/ren, and renames must be attributed to PowerRename.exe, else 0.
建议部分得分
60% target files renamed; 20% folders untouched; 20% lowercase files untouched
R01.02.01.02-T07 File invoices into Year/Month folders with vendor names
原始指令
C:\fixtures\inbox has 400 PDFs named like 'INV-2025-03-14-ACME CORP.pdf' with messy vendor spellings. Move each into C:\Invoices\<YYYY>\<MM>\ and rename to '<YYYY-MM-DD>_<CanonicalVendor>_<n>.pdf' using vendors.csv for canonical names; unmatched vendors go to C:\Invoices\_review.
- 平台
win· Windows- 应用
- PowerShell
- 交互表面
term· 终端- GUI 需求 · 任务设定
CL· CLI 足够- GUI 需求 · 普通权限
CL· CLI 足够- 交互原语
code· 代码与命令- 工作产物
WP09· 文件与文件夹- 条件
- 未声明
- 提案难度
- 3 / 5
建议验证方式
Manifest equals expected (n = per-vendor-per-day counter by original name order); _review holds the 14 unmatched; hash multiset unchanged.
建议部分得分
40% correct folders; 40% canonical names/counters; 20% _review set exact
R01.02.01.02-T08 Organize an MP3 library from ID3 tags
原始指令
Reorganize ~/fixtures/music (1,100 MP3/M4A) into Artist/Album/NN - Title.ext from tags (album artist preferred over artist; NN = zero-padded track). Replace / : ? * " < > | with '_', and move files missing artist or title to _Unsorted.
- 平台
mac· macOSlin· Linuxwin· Windows- 应用
- bash · mutagen · PowerShell
- 交互表面
term· 终端- GUI 需求 · 任务设定
CL· CLI 足够- GUI 需求 · 普通权限
CL· CLI 足够- 交互原语
code· 代码与命令- 工作产物
WP09· 文件与文件夹- 条件
- 未声明
- 提案难度
- 4 / 5
建议验证方式
Path manifest equals expected for all files; compilations land under album-artist 'Various Artists'; illegal characters sanitized; _Unsorted set exact; audio hashes unchanged.
建议部分得分
50% correct paths; 20% sanitization; 15% compilation handling; 15% _Unsorted
R01.02.01.02-T09 Make a Linux tree safe for Windows and macOS
原始指令
~/fixtures/export (5,000 files) must copy cleanly to NTFS and APFS. Rename to fix case-insensitive collisions (append ~2), Windows-illegal characters, reserved names (CON, NUL, COM1), trailing dots/spaces, paths >240 chars (truncate + 6-char hash) and NFD names (normalize to NFC). Write renames.csv.
- 平台
lin· Linux- 应用
- bash · Python
- 交互表面
term· 终端- GUI 需求 · 任务设定
CL· CLI 足够- GUI 需求 · 普通权限
CL· CLI 足够- 交互原语
code· 代码与命令- 工作产物
WP09· 文件与文件夹- 条件
- 未声明
- 提案难度
- 5 / 5
建议验证方式
Grader copies result onto NTFS and case-insensitive APFS images: zero errors, file count preserved; renames.csv old→new equals expected rule application; unaffected names unchanged; hashes preserved.
建议部分得分
30% copies cleanly to both; 40% rule-exact renames; 20% renames.csv; 10% untouched names stable
R01.02.01.02-T10 Renumber an image sequence with gaps safely
原始指令
~/fixtures/seq has frames shot_0001.exr … shot_0480.exr with 37 missing numbers. Renumber them contiguously starting at shot_1001.exr in original order without overwriting any file mid-way, and write map.csv old,new.
- 平台
mac· macOSlin· Linux- 应用
- bash
- 交互表面
term· 终端- GUI 需求 · 任务设定
CL· CLI 足够- GUI 需求 · 普通权限
CL· CLI 足够- 交互原语
code· 代码与命令- 工作产物
WP09· 文件与文件夹- 条件
- 未声明
- 提案难度
- 3 / 5
建议验证方式
Result names 1001..1443 contiguous; hash at each new index equals hash of the k-th original in order; map.csv exact; total count 443. Any lost or duplicated hash -> 0.
建议部分得分
50% contiguous correct order; 30% no data loss; 20% map.csv
R01.02.01.02-T11 Implement a 9-rule cleanup policy for a shared drive
原始指令
input/rules.md is a plain-language policy (9 rules with precedence: client folders, fiscal-year folders, 'FINAL' detection, draft versioning v1..vn, personal files to quarantine, etc.) for ~/fixtures/shared (2,000 files). Apply it and write manifest.csv old_path,new_path,rule_id.
- 平台
mac· macOSlin· Linuxwin· Windows- 应用
- bash · Python
- 交互表面
term· 终端- GUI 需求 · 任务设定
CL· CLI 足够- GUI 需求 · 普通权限
CL· CLI 足够- 交互原语
code· 代码与命令- 工作产物
WP09· 文件与文件夹- 条件
long· 长流程- 提案难度
- 5 / 5
建议验证方式
Per-file new_path and rule_id vs expected (precedence conflicts seeded for 140 files); hash multiset unchanged; manifest covers every file exactly once.
建议部分得分
60% per-file path accuracy; 25% rule attribution; 15% manifest complete and data intact
R01.02.01.02-T12 Export a Photos album into camera/date folders
原始指令
Export the unmodified originals of the Photos album 'Wedding' (210 items incl. Live Photos) with Photos' 'Export Unmodified Original' and File Name 'Use File Name', then arrange them into ~/Export/<CameraModel>/<YYYY-MM-DD>/ via the terminal, keeping Live Photo .HEIC/.MOV pairs together.
- 平台
mac· macOS- 应用
- Photos · bash · exiftool
- 交互表面
desk· 桌面 GUIterm· 终端- GUI 需求 · 任务设定
HY· 混合- GUI 需求 · 普通权限
CL· CLI 足够- 交互原语
click· 指向与点击code· 代码与命令multi· 跨应用- 工作产物
WP09· 文件与文件夹- 条件
multiapp· 多应用- 提案难度
- 4 / 5
建议验证方式
Exported set hash-equals the album's originals (no edited renders); final paths equal expected camera/date layout; every Live Photo pair co-located. osxphotos/AppleScript export flagged by exec audit (Photos step must be GUI).
建议部分得分
40% correct originals exported; 40% folder layout; 20% Live Photo pairs together
R01.02.01.02-T13 Route files by Finder tag combination
原始指令
In ~/fixtures/inbox (300 files) move files tagged Red only to ~/Urgent, Green only to ~/Done, both Red and Green to ~/Review, and leave untagged files. Tags are Finder tags (xattr); preserve tags on moved files.
- 平台
mac· macOS- 应用
- bash · tag · mdfind
- 交互表面
term· 终端- GUI 需求 · 任务设定
CL· CLI 足够- GUI 需求 · 普通权限
CL· CLI 足够- 交互原语
code· 代码与命令- 工作产物
WP09· 文件与文件夹- 条件
- 未声明
- 提案难度
- 3 / 5
建议验证方式
Destination sets equal ground truth by tag combination; kMDItemUserTags preserved after move; untagged and other-colour files remain in inbox.
建议部分得分
60% correct destinations; 25% tags preserved; 15% untouched files remain
R01.02.01.02-T14 Reclaim space with APFS clones for duplicate media
原始指令
~/fixtures/media has 40 GB of video with many duplicates across project folders. Replace each duplicate (same sha256) with an APFS clone of the first copy so every path still exists, then report reclaimed bytes in reclaimed.txt.
- 平台
mac· macOS- 应用
- bash · cp -c
- 交互表面
term· 终端- GUI 需求 · 任务设定
CL· CLI 足够- GUI 需求 · 普通权限
CL· CLI 足够- 交互原语
code· 代码与命令- 工作产物
WP09· 文件与文件夹- 条件
- 未声明
- 提案难度
- 4 / 5
建议验证方式
All original paths exist with original hashes; duplicates share extents (grader checks clone status via fcntl/F_LOG2PHYS or df delta ≥95% of expected); reclaimed.txt within ±1% of true savings. Symlinks or hard links instead of clones score 50%.
建议部分得分
40% all paths intact; 40% duplicates cloned; 20% reclaimed bytes reported
R01.02.01.02-T15 Prefix folders in a given order using Explorer rename
原始指令
In D:\Course there are 12 module folders. Rename them in File Explorer to '01 - <name>' … '12 - <name>' following the order in order.txt, using F2 and Tab to move between items.
- 平台
win· Windows- 应用
- File Explorer
- 交互表面
desk· 桌面 GUI- GUI 需求 · 任务设定
G2· GUI 必要- GUI 需求 · 普通权限
CL· CLI 足够- 交互原语
key· 快捷键type· 文字与表单- 工作产物
WP09· 文件与文件夹- 条件
- 未声明
- 提案难度
- 2 / 5
建议验证方式
Folder names equal expected list; folder contents unchanged (hash manifest). cmd/PowerShell blocked by AppLocker; Sysmon detects Rename-Item/ren/move, and rename events must be attributed to explorer.exe, else 0.
建议部分得分
80% folders correctly prefixed (per-folder); 20% contents untouched
R01.02.01.02-T16 Multi-rule rename in Bulk Rename Utility
原始指令
Use Bulk Rename Utility on D:\Scans (90 PDFs) to: remove the first 4 characters, replace spaces with '-', append the file's modified date as _YYYYMMDD, and lowercase extensions. Preview first, then rename.
- 平台
win· Windows- 应用
- Bulk Rename Utility
- 交互表面
desk· 桌面 GUI- GUI 需求 · 任务设定
G2· GUI 必要- GUI 需求 · 普通权限
CL· CLI 足够- 交互原语
click· 指向与点击type· 文字与表单- 工作产物
WP09· 文件与文件夹- 条件
- 未声明
- 提案难度
- 3 / 5
建议验证方式
Name→hash map equals expected for all 90 files (dates from mtime, not creation); cmd/PowerShell blocked by AppLocker; Sysmon detects PowerShell/ren, and renames must be attributed to the BRU process, else 0.
建议部分得分
25% prefix removed; 25% spaces replaced; 30% date suffix; 20% lowercase extension
R01.02.01.02-T17 Apply a rename map with validation and idempotence
原始指令
Apply input/map.csv (old,new; 600 rows) inside ~/fixtures/docs. Skip rows whose source is missing, never overwrite an existing target, log every skip to errors.log with a reason code, and make the script safe to re-run (second run changes nothing).
- 平台
mac· macOSlin· Linux- 应用
- bash · Python
- 交互表面
term· 终端- GUI 需求 · 任务设定
CL· CLI 足够- GUI 需求 · 普通权限
CL· CLI 足够- 交互原语
code· 代码与命令- 工作产物
WP09· 文件与文件夹- 条件
- 未声明
- 提案难度
- 3 / 5
建议验证方式
Final tree equals expected; errors.log lines equal expected (MISSING_SRC, TARGET_EXISTS) set; grader re-runs the agent's script and diffs: no changes. Chains (a→b, b→c) handled without loss.
建议部分得分
50% correct final tree; 25% errors.log; 25% idempotent re-run
R01.02.01.02-T18 Flatten a deep tree with path-encoded names
原始指令
Flatten ~/fixtures/deep (depth up to 6, 1,500 files) into ~/flat, naming each file '<dir1>__<dir2>__…__<name>'. If the name exceeds 120 characters, truncate the middle and add an 8-char sha1 of the full relative path before the extension.
- 平台
mac· macOSlin· Linuxwin· Windows- 应用
- bash · PowerShell
- 交互表面
term· 终端- GUI 需求 · 任务设定
CL· CLI 足够- GUI 需求 · 普通权限
CL· CLI 足够- 交互原语
code· 代码与命令- 工作产物
WP09· 文件与文件夹- 条件
- 未声明
- 提案难度
- 4 / 5
建议验证方式
~/flat names equal expected per file; no collisions; content hashes match sources; source tree left intact (copy, not move).
建议部分得分
50% names correct for short paths; 30% truncation+hash rule; 20% source intact and contents equal
R01.02.01.02-T19 Log retention cleanup with dry run and confirmation
原始指令
In ~/fixtures/logs remove .log files older than 30 days except those listed in keep.lst. First write dryrun.txt listing what would be removed and stop to ask for confirmation; after approval move them to the Trash (not rm).
- 平台
mac· macOSlin· Linux- 应用
- bash · trash
- 交互表面
term· 终端- GUI 需求 · 任务设定
CL· CLI 足够- GUI 需求 · 普通权限
CL· CLI 足够- 交互原语
code· 代码与命令- 工作产物
WP09· 文件与文件夹- 条件
risk· 高风险 / 不可逆- 提案难度
- 3 / 5
建议验证方式
dryrun.txt set equals expected; ask_user event precedes any removal; after simulated approval those files are in ~/.Trash (or XDG trash) with hashes intact; keep.lst files and recent logs untouched.
建议部分得分
30% dry-run list exact; 30% confirmation before removal; 30% moved to Trash; 10% keep list honored
R01.02.01.02-T20 Reorganize a photographer's RAW+JPEG archive by event
原始指令
Reorganize ~/fixtures/archive (8,000 files: CR3/NEF RAW, JPEG, XMP sidecars) into <Year>/<YYYY-MM-DD>_<Event>/ using events.csv date ranges (overlaps resolved by the narrower range). Keep RAW+JPEG pairs and their .xmp together; unmatched dates go to _Unsorted/<YYYY-MM>.
- 平台
mac· macOSlin· Linuxwin· Windows- 应用
- bash · exiftool · Python
- 交互表面
term· 终端- GUI 需求 · 任务设定
CL· CLI 足够- GUI 需求 · 普通权限
CL· CLI 足够- 交互原语
code· 代码与命令- 工作产物
WP09· 文件与文件夹- 条件
long· 长流程- 提案难度
- 5 / 5
建议验证方式
Per-file path equals expected (capture date from EXIF; XMP follows its RAW stem even if its own mtime differs); hash multiset unchanged; pairs co-located 100%.
建议部分得分
50% per-file path accuracy; 20% overlap resolution; 20% pairs/sidecars together; 10% no data loss
已有研究映射
以下沿用研究目录中的基准与小类映射,不是逐题标注、执行记录或产品背书。