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'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?
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'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?
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?
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?
Does adding a prefix change the file extension?
Can you add a prefix to files inside subfolders?
What happens if two files get the same name after adding a prefix?
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 StoreMarcel 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.