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在Hacker News上分享了“f2”,这是一个跨平台的命令行工具,用于快速灵活地批量重命名文件。它具有试运行模式、撤销支持、内置变量和Exiftool集成。 用户称赞了该工具的CLI设计和用户体验,并强调了Exiftool集成在组织图像方面的作用。一些用户建议使用其他工具,例如`vidir`(moreutils的一部分)、Emacs的dired和Double Commander的多重命名工具。一位用户请求添加一个功能,可以根据示例自动推导出重命名模式,而不是使用正则表达式,就像他们之前使用的一个.net工具那样。其他人提到了他们使用的现有工具,例如PowerToys。有人建议增加一个“向上”模式,以便在添加更多标志时,以实时更新的方式查看试运行输出。Ayoisaiah感谢用户的反馈,并对积极的回应表示兴奋。

原文

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