获取Perl重命名实用程序而不是内置重命名
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 theutil-linux
package (hence the .ul suffix)- 来自util-linux软件包的/usr/bin/rename.ul(因此.ul后缀)
/usr/bin/prename
from theperl
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
更多相关文章
- MySQL5.5.22版本安装配置以及基本命令的使用和管理数据库备份与
- Mysql5.7.10版本安装后空密码登录,退出后提示密码错误连接不上解
- MySQL5.7.11版本,64位绿色版安装
- Linux操作系统Centos7.2版本搭建Apache+PHP+Mysql环境
- MySQL——问题:mysql(5.7版本)目录下没有data文件夹
- MySQL基础入门学习【7】查询表达式解析 SELECT
- Web开发实战学习(涉及EL表达式,JSTL,数据库)
- 内网安装mysql主从服务,mysql版本5.6.38-winx64
- android版本与linux内核版本对应关系