我有一个名为的文件35554842200284685106000166550020003504201637715423.xml
,我只需将其重命名为42200284685106000166550020003504201637715423.xml
(删除最后 48 个字符之前的所有内容)。这个简单的正则表达式 ( .{48}$
) 可以提取最后 48 个字符,但我无法rename
在 Bash 中使用它。
如何使用rename
此正则表达式将其重命名为仅最后 48 个字符?
编辑:
输出 rename --help
[root@ip-000-00-0-000 tmp]# rename --help
Usage:
rename [options] <expression> <replacement> <file>...
Rename files.
Options:
-v, --verbose explain what is being done
-s, --symlink act on the target of symlinks
-n, --no-act do not make any changes
-h, --help display this help and exit
-V, --version output version information and exit
For more details see rename(1). …
Run Code Online (Sandbox Code Playgroud)