How to Add a Prefix to Multiple Filenames on Mac

Prefixing filenames is one of the most common batch rename operations. Adding text before the filename organizes files by project, date, client, or version. macOS provides three ways to add prefixes: Finder's Add Text mode, Terminal for loops, and Batchio's Add Text rule.

How Do You Add a Prefix to Filenames in Finder?

Finder adds a prefix to filenames through its Add Text rename mode. Select the files you want to rename, right click, choose Rename, select Add Text, type the prefix string, and choose Before Name from the position dropdown. Finder applies the prefix to every selected file instantly.

Finder's Add Text mode is the simplest approach for adding a prefix on macOS. The entire operation requires no additional software and completes in a few clicks. Select any number of files in Finder, right click, and choose Rename from the context menu. The rename dialog opens with three modes. Choose Add Text, type the prefix you want, and select Before Name from the dropdown on the right side.

Finder applies the same prefix to every selected file. There is no way to add different prefixes based on file type, no support for dynamic values like dates or counters, and no option to insert text at a specific character position. Finder covers the basic case where every file receives the same static prefix string. For conditional or dynamic prefixes, a more capable tool is required.

How Do You Add a Prefix Using Terminal on Mac?

Terminal adds a prefix to filenames using a for loop with the mv command. The command for f in *.jpg; do mv "$f" "prefix_$f"; doneprepends the string "prefix_" to every JPEG file in the current directory. Terminal provides full control over the prefix logic through shell scripting.

Terminal gives you complete control over prefix operations through shell scripting. The basic pattern iterates through files matching a glob pattern and renames each one with themv command. You can construct the new filename using variable substitution, conditionals, and string manipulation. For example, adding a date prefix uses$(date +%Y%m%d) to generate the current date dynamically.

Terminal commands execute immediately with no preview. A mistake in the prefix string or the glob pattern can rename hundreds of files incorrectly. Terminal provides no built in undo, so reversing a bad prefix operation requires writing a second script to strip the added text. For a complete walkthrough of Terminal renaming commands, see the Terminal rename guide. Batchio's live preview shows every prefixed filename before you commit.

How Does Batchio Add Prefixes to Multiple Files?

Batchio adds prefixes through the Add Text rule with the position set to Before Name. Drag files onto the window, add an Add Text rule, type the prefix, and verify every change in the live preview. Batchio supports static text, counters, and combining the prefix rule with other rule types.

Batchio's Add Text rule provides a visual interface for prefix operations. Set the position to Before Name, type the prefix string, and the live preview updates immediately. Every file shows its original name alongside the new prefixed name, making it easy to verify the result before committing. The rule works on any number of files and supports subfolder scanning for bulk operations across directory trees.

You can combine the Add Text rule with other rule types for complex prefix workflows. Stack a numbering rule after the prefix to add sequential counters. Add a change case rule to standardize the prefix format. The rule chain executes in order from top to bottom, and you can drag rules to reorder them or disable individual rules to test different combinations. See how suffixes work in the suffix guide for the companion operation.

Can You Add Different Prefixes Based on File Type?

Finder cannot add different prefixes based on file type in a single operation. Terminal scripts can use conditional logic to apply different prefixes per extension. Batchio supports filtering files by extension and applying separate prefix rules to each group, making type based prefixing straightforward.

Conditional prefixing is a common requirement for mixed file collections. Photographers may want "RAW_" before .cr2 files and "JPEG_" before .jpg files. Developers may want "src_" before code files and "doc_" before documentation files. Finder requires separate rename operations for each file type, which means selecting files by extension manually and running the Add Text rename multiple times.

Terminal handles conditional prefixes through shell scripting with if statements or case blocks inside the forloop. The script checks each file's extension and applies the appropriate prefix. Batchio provides the same flexibility through its rule system. Filter the file list by extension, apply the prefix rule, then repeat for the next file type. The live preview confirms each group receives the correct prefix before you commit. Learn about combining rules in the batch rename guide.

What Are Common Prefix Naming Conventions?

Common prefix conventions include date stamps (2026_03_26_), project codes (PROJ_), version numbers (v2_), client names (ClientName_), and status indicators (FINAL_, DRAFT_). Consistent prefix conventions improve file organization and make sorting, searching, and filtering faster across large collections.

Date prefixes in YYYY_MM_DD format sort files chronologically in Finder because Finder sorts alphabetically by default. Placing the year first ensures that files from 2025 appear before files from 2026 in any sorted directory listing. Project code prefixes group related files together regardless of their original names, which is especially useful when merging files from multiple sources into a single directory.

Version prefixes like v1_, v2_, v3_ track iterations of deliverables. Status prefixes like DRAFT_ and FINAL_ communicate file state at a glance. Client name prefixes organize freelance work by customer. The key principle is consistency: choose one convention and apply it uniformly. Batchio's saved presets (Pro feature) store your prefix rules so you can reapply the same convention to new file batches with a single click.

Frequently Asked Questions

Can Finder add a prefix to multiple filenames at once?
Finder can add a prefix to multiple filenames using its Add Text rename mode. Select the files, right click, choose Rename, select Add Text, type the prefix, and choose Before Name from the dropdown. Finder applies the same prefix to every selected file in one operation.
Does adding a prefix change the file extension?
Adding a prefix does not change the file extension. The prefix is inserted before the filename only. A file named report.pdf with the prefix 2026_ becomes 2026_report.pdf. The .pdf extension remains unchanged because the prefix targets the beginning of the name, not the end.
Can you add a prefix to files inside subfolders?
Finder only renames files in the current folder view. It does not recurse into subfolders. Terminal commands with the find utility can add prefixes to files across nested directories. Batchio supports subfolder scanning with a single toggle, applying the prefix rule to every file in the folder tree.
What happens if two files get the same name after adding a prefix?
Finder skips files that would create duplicate names and shows an error. Terminal overwrites files silently if two files resolve to the same name after the prefix operation. Batchio detects naming conflicts in the live preview before renaming starts, letting you resolve duplicates before committing.

Add Prefixes to Filenames in Seconds

Download Batchio free on the Mac App Store. All 9 rule types included. Pro upgrade $4.99.

Coming Soon to the Mac App Store
Marcel Iseli
Marcel Iseli

Creator of Batchio · Indie App Developer

LinkedIn ↗

Marcel Iseli is an indie app developer and the creator of Batchio. He builds native macOS utilities focused on productivity and file management, with a focus on lightweight, subscription-free tools.