Show HN:F2——跨平台命令行批量重命名工具
Show HN: F2 – Cross-Platform CLI Batch Renaming Tool

原始链接: https://github.com/ayoisaiah/f2

F2是一个使用Go语言编写的跨平台命令行工具,旨在快速安全地批量重命名文件和目录。与其他重命名工具不同,F2默认进行试运行,允许用户在执行之前预览更改。它支持变量,可以使用EXIF或ID3标签等文件属性进行重命名,从而提高灵活性。 F2提供全面的选项,从简单的字符串替换到复杂的正则表达式。安全性至关重要,它会进行严格的检查以确保操作无冲突且无错误。内置的冲突解决功能会自动解决重命名冲突。 性能是其关键特性,可以快速重命名数千个文件。它还提供撤销功能,可以轻松恢复更改。F2提供了丰富的文档,包含实际示例。Go开发者可以使用`go install github.com/ayoisaiah/f2/v2/cmd/f2@latest`进行安装,其他操作系统也可以使用预编译的二进制文件。

Ayoisaiah shared "f2," a cross-platform command-line tool for batch renaming files on Hacker News. Users praised its features like dry-run by default, undo functionality, Exiftool integration, and flexible renaming options. Several commenters highlighted the well-designed CLI and the tool's ability to organize image libraries using EXIF data. One user suggested a pattern-based renaming feature, which Ayoisaiah showed could be achieved with capture variables. Another user noted a minor typo in the documentation. Several other alternatives were suggested, including `vidir` from `moreutils` and `fled`. The tool's name was also widely praised. Overall, the feedback was overwhelmingly positive, with many users expressing immediate plans to adopt f2 into their workflow.

原文

f2

Github Actions made-with-Go GoReportCard Go.mod version LICENCE Latest release

F2 is a cross-platform command-line tool for batch renaming files and directories quickly and safely. Written in Go!

What does F2 do differently?

Compared to other renaming tools, F2 offers several key advantages:

  • Dry Run by Default: It defaults to a dry run so that you can review the renaming changes before proceeding.

  • Variable Support: F2 allows you to use file attributes, such as EXIF data for images or ID3 tags for audio files, to give you maximum flexibility in renaming.

  • Comprehensive Options: Whether it's simple string replacements or complex regular expressions, F2 provides a full range of renaming capabilities.

  • Safety First: It prioritizes accuracy by ensuring every renaming operation is conflict-free and error-proof through rigorous checks.

  • Conflict Resolution: Each renaming operation is validated before execution and detected conflicts can be automatically resolved.

  • High Performance: F2 is extremely fast and efficient, even when renaming thousands of files at once.

  • Undo Functionality: Any renaming operation can be easily undone to allow the easy correction of mistakes.

  • Extensive Documentation: F2 is well-documented with clear, practical examples to help you make the most of its features without confusion.

If you're a Go developer, F2 can be installed with go install (requires v1.23 or later):

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

Other installation methods are documented here or check out the releases page to download a pre-compiled binary for your operating system.

F2 can utilise Exif attributes to organise image files

Bug reports and feature requests are much welcome! Please open an issue before creating a pull request.

Created by Ayooluwa Isaiah and released under the terms of the MIT Licence.

联系我们 contact @ memedata.com