| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
![]() |
原始链接: https://news.ycombinator.com/item?id=44081850
Ayoisaiah在Hacker News上分享了“f2”,这是一个跨平台的命令行工具,用于快速灵活地批量重命名文件。它具有试运行模式、撤销支持、内置变量和Exiftool集成。 用户称赞了该工具的CLI设计和用户体验,并强调了Exiftool集成在组织图像方面的作用。一些用户建议使用其他工具,例如`vidir`(moreutils的一部分)、Emacs的dired和Double Commander的多重命名工具。一位用户请求添加一个功能,可以根据示例自动推导出重命名模式,而不是使用正则表达式,就像他们之前使用的一个.net工具那样。其他人提到了他们使用的现有工具,例如PowerToys。有人建议增加一个“向上”模式,以便在添加更多标志时,以实时更新的方式查看试运行输出。Ayoisaiah感谢用户的反馈,并对积极的回应表示兴奋。
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
![]() |
Another approach I recently discovered is an old but beautiful Unix-style tool for renaming files: vidir - edit a directory in your text editor. It’s part of the moreutils suite [1].
You get the list of filenames in your editor – edit them as you like, save, exit, and it renames the files. It uses whatever editor is set in your $EDITOR env var, so it doesn’t have to be vi/vim.
You can also pipe in a list of files, e.g. `find . -type f | vidir -`, to edit just the files you want - and you can even change paths (add, rename, remove directories) in the editor to move files around easily.
To try it quickly on macOS: `brew install moreutils`
[1] https://joeyh.name/code/moreutils/
reply