【发布时间】:2015-11-21 13:07:00
【问题描述】:
我有数百个这样格式的 id 文件
106527-Sup, Perman .jpg
106528-Iron, man .jpg
106529-Bat, man .jpg
106530-Spider, man .jpg
我需要将它们重命名为
106527.jpg
106528.jpg
106529.jpg
106530.jpg
如何使用正则表达式和重命名命令
【问题讨论】:
-
rename -n 's/^(\d+).*\.jpg$/$1/' *.jpg适合你吗? -
如果 Maroun 的回答对您有用,请接受。