NBIR — Numeric Bulk File Renamer
Rename files in a directory to a sequential numbered scheme (e.g. base01.jpg, base02.pdf). Supports all file types. You can select by extension (all .jpg, .pdf, etc.), by specific filenames, or both—e.g. all images plus one or two PDFs.
Installation
From crates.io:
From source:
Usage
List only (no renaming): See what’s in a directory, grouped by extension:
Interactive mode (no args): Run nbir with no options. It will ask:
- “Do you want to run it in the current directory? (y/n)”
- Show files by extension, then: “Extensions to include (comma-separated, or 'all'/'whole' for whole directory)”
- “Specific files to add (comma-separated, or leave empty)” — skipped if you chose whole directory in step 2
- “Enter base name (e.g., spacewallpaper)”
- Preview and “Proceed with renaming? (y/n)”
For whole directory in step 2, answer all, whole, whole dir, or entire (case-insensitive). You then skip the “Specific files” prompt and go straight to base name.
CLI mode: Use -b for base name and -e / -f / --all to choose which files to rename:
Options
| Short | Long | Default | Description |
|---|---|---|---|
-b |
--base-name |
— | Base name for renamed files. If omitted, prompts interactively. |
-d |
--directory |
. |
Directory to work in |
-l |
--list |
— | List files grouped by extension, then exit |
| — | --all |
— | Include all files (ignores -e and -f) |
-e |
--ext |
— | Include all files with these extensions (e.g. -e jpg,png or -e jpg -e pdf). Case-insensitive. |
-f |
--files |
— | Include these specific filenames (e.g. -f doc.pdf -f readme.txt) |
-y |
--yes |
false |
Skip confirmation; rename immediately |
If you pass -b but neither -e, -f, nor --all, all files in the directory are selected.
Examples
List what’s in the current directory:
All files of certain extensions:
Only a few specific files:
Both: all of one extension plus a couple of another:
All files in the directory:
Interactive (prompts for extensions, specific files, and base name):