【发布时间】:2021-08-18 19:18:29
【问题描述】:
我有一个文件列表。它们目前按此顺序出现:
Advance Topics in Graphs _ Lec 11 _ Discrete Mathematics _ Exam-lAN6B0Hvy7E.webm
Basics of Combinatorics _ Lec 12 _ Discrete Mathematics _ Exam-sBg13JNUQQ8.webm
Basics of Graph Theory _ Lec 6 _ Discrete Mathematics _ Exam-JqgdPH-PEIM.webm
Basics of Relations - 2 _ Lec 20 _ Discrete Mathematics _ Exam-CTo9pvl__5M.webm
Basics of Relations _ Lec 19 _ Discrete Mathematics _ Exam-4KTaggHRd54.webm
Basics of Sets _ Lec 18 _ Discrete Mathematics _ Exam-LE-Gt_PUdws.webm
我想重命名文件,使文件名具有以下模式(为清楚起见,使用正则表达式表示)Lec\s[0-9]?[0-9]?文件名的中间,出现在文件名的开头。(这是排序顺序)。
最终结果将如下所示:
Lec 6 Basics of Graph Theory _ _ Discrete Mathematics _ Exam-JqgdPH-PEIM.webm
Lec 11 Advance Topics in Graphs _ _ Discrete Mathematics _ Exam-lAN6B0Hvy7E.webm
Lec 12 Basics of Combinatorics _ _ Discrete Mathematics _ Exam-sBg13JNUQQ8.webm
Lec 18 Basics of Sets _ _ Discrete Mathematics _ Exam-LE-Gt_PUdws.webm
Lec 19 Basics of Relations _ _ Discrete Mathematics _ Exam-4KTaggHRd54.webm
Lec 20 Basics of Relations - 2 _ _ Discrete Mathematics _ Exam-CTo9pvl__5M.webm
【问题讨论】:
-
未来,您可以更改youtube-dl 的输出,以在播放列表或序列中添加前缀(如果您是这样观看视频的)!
-
@ti7 我总是这样做。但是我从我的朋友那里得到了这个内容。大声笑
-
查看您是否有
rename/prename可用。 -
@Shawn 找不到包(前名)。我将安装重命名。
-
@Shawn 我不知道 perl。能否请您框定表达式?
标签: linux shell command-line