Many sites (including various SO articles) talk about using "rename" using Perl expressions to rename files.

许多网站(包括各种SO文章)都谈到使用Perl表达式重命名文件来“重命名”。

This would be perfect, but apparently this is not the rename utility I have, and none of these articles seem to comprehend that there are multiple versions of "rename" and I can't seem to find where to get version that accepts Perl expressions.

这将是完美的,但显然这不是我的重命名实用程序,并且这些文章似乎都没有理解有“rename”的多个版本,我似乎无法找到接受Perl表达式的版本的位置。

How can I get my hands on the more powerful rename utility mentioned here, here, and here?

我怎样才能掌握这里,这里和这里提到的更强大的重命名工具?

I'm running Fedora 20. My current rename command is from the util-linux package and apparently I need the Perl version, which is better.

我正在运行Fedora 20.我当前的rename命令来自util-linux包,显然我需要Perl版本,这更好。

4 个解决方案

#1


15

I can only speak for Debian. The two programs are called

我只能说Debian。这两个程序被调用

  • /usr/bin/rename.ul from the util-linux package (hence the .ul suffix)
  • 来自util-linux软件包的/usr/bin/rename.ul(因此.ul后缀)
  • /usr/bin/prename from the perl package
  • 来自perl包的/ usr / bin / prename

The actual rename command works via the the /etc/alternatives mechanism, whereby

实际的重命名命令通过/ etc / alternatives机制起作用

  • /usr/bin/rename is a symlink to /etc/alternatives/rename
  • / usr / bin / rename是/ etc / alternatives / rename的符号链接
  • /etc/alternatives/rename is a symlink to /usr/bin/prename
  • / etc / alternatives / rename是/ usr / bin / prename的符号链接

The same problem has been bugging me on Cygwin, which is a Red Hat product, so should be more similar to Fedora. I'll have a look on my company laptop on Monday. And I remember the Perl-rename having worked there sometimes. Probably before I installed util-linux.

同样的问题一直困扰着Cygwin,这是一个Red Hat产品,所以应该更像Fedora。我星期一看看我公司的笔记本电脑。我记得Perl-rename曾经在那里工作过。可能在我安装util-linux之前。

If you install the Perl-rename to /usr/local/bin it will have precedence over rename from util-linux. Same goes for the manpage when installed to /usr/local/share/man/man1/.

如果将Perl-rename安装到/ usr / local / bin,它将优先于从util-linux重命名。安装到/ usr / local / share / man / man1 /时的联机帮助页也是如此。

I've just created a separate Perl-rename package on Github: https://github.com/subogero/rename

我刚刚在Github上创建了一个单独的Perl-rename包:https://github.com/subogero/rename

更多相关文章

  1. MySQL5.5.22版本安装配置以及基本命令的使用和管理数据库备份与
  2. Mysql5.7.10版本安装后空密码登录,退出后提示密码错误连接不上解
  3. MySQL5.7.11版本,64位绿色版安装
  4. Linux操作系统Centos7.2版本搭建Apache+PHP+Mysql环境
  5. MySQL——问题:mysql(5.7版本)目录下没有data文件夹
  6. MySQL基础入门学习【7】查询表达式解析 SELECT
  7. Web开发实战学习(涉及EL表达式,JSTL,数据库)
  8. 内网安装mysql主从服务,mysql版本5.6.38-winx64
  9. android版本与linux内核版本对应关系

随机推荐

  1. JavaScript 实现GridView汇总
  2. 如何使用try,catch在错误处理中打印消息
  3. javascript之DOM技术(二)
  4. 有没有办法在javascript控制台中将上下文
  5. 如何使用Require JS配置具有第三方js依赖
  6. JavaScript——数组(三)数组方法汇总
  7. 切换元素类并使用旧类在视图中添加新元素
  8. 阻止用户在表单字段中输入
  9. req.files.upload.length返回文件计数为
  10. js 学习之路9:运算符