Operations 12 min read

Master Bulk File Renaming on Any OS with F2 – The Ultimate Command‑Line Tool

F2 is a cross‑platform command‑line utility that lets you safely batch‑rename files and folders on Windows, macOS, and Linux, offering dry‑run previews, metadata‑based naming, regex support, recursive processing, undo, and conflict‑resolution features.

Liangxu Linux
Liangxu Linux
Liangxu Linux
Master Bulk File Renaming on Any OS with F2 – The Ultimate Command‑Line Tool

What is F2?

F2 is a cross‑platform command‑line utility for bulk renaming of files and directories. It runs on Windows, macOS, and Linux and emphasizes safety with a dry‑run mode and conflict detection. Variable substitution from file metadata (EXIF, ID3) is supported.

Key Features

Cross‑platform support (Windows, macOS, Linux).

Dry‑run mode ( -x) to preview changes before applying.

Metadata variables (EXIF dates, camera model, ID3 artist/album).

Full‑text and regular‑expression replace ( -e).

Recursive processing ( -R) with optional depth control.

Automatic conflict resolution ( --auto) or forced overwrite ( --replace).

Undo capability ( f2 --undo).

Extensive documentation and examples.

Installation

macOS

Homebrew

brew install f2
f2 --version

Binary tar.gz from the GitHub releases page: download, extract, chmod +x, move to /usr/local/bin.

Linux

Download the appropriate tar.gz, .deb or .rpm from the GitHub releases page and install with tar, dpkg or rpm.

Arch Linux:

yay -S f2-bin

Windows

Download the Windows tar.gz, extract, place f2.exe in a directory and optionally add it to PATH.

Package managers:

Winget: winget install ayoisaiah.f2 Scoop:

scoop bucket add ayoisaiah-scoop-bucket https://github.com/ayoisaiah/scoop-bucket
scoop install f2

Chocolatey:

choco install f2

From source

Go

go install github.com/ayoisaiah/f2/v2/cmd/f2@latest
f2 --version

NPM

npm i @ayoisaiah/f2 -g
f2 --version

Basic Usage Examples

Add a prefix to all files in the current directory: f2 -r 'doc_{f}{ext}' . Search and replace a word: f2 -f 'old' -r 'new' . Use regular expressions: f2 -e -f 'project[0-9]' -r 'plan' . Organize photos by EXIF date:

f2 -r '{x.cdt.YYYY}/{x.cdt.MM}/{x.cdt.YYYY}-{x.cdt.MM}-{x.cdt.DD}_{n}{ext}' -R --target-dir .

Recursively rename files in subfolders: f2 -f 'IMG' -r 'Party' -R . Undo the last operation: f2 --undo Resolve naming conflicts automatically or force overwrite:

f2 --auto ...
# or
f2 --replace ...

Advanced Options

Include hidden files with -H.

Case transformations: {lc} for lower‑case, {uc} for upper‑case.

Number files using the {n} placeholder.

Rename based on ID3 tags: f2 -r '{id3.artist}/{id3.album}/{id3.title}{ext}'.

Reference

GitHub project: https://github.com/ayoisaiah/f2/
Original Source

Signed-in readers can open the original source through BestHub's protected redirect.

Sign in to view source
Republication Notice

This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactadmin@besthub.devand we will review it promptly.

AutomationLinuxFile Renamingbatch renameF2 tool
Liangxu Linux
Written by

Liangxu Linux

Liangxu, a self‑taught IT professional now working as a Linux development engineer at a Fortune 500 multinational, shares extensive Linux knowledge—fundamentals, applications, tools, plus Git, databases, Raspberry Pi, etc. (Reply “Linux” to receive essential resources.)

0 followers
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.