![](/img/trans.png)
[英]How do I find and replace a character when it is not one of the first 8 characters in the filename using prename?
[英]How do I find a pattern and rename the file inserting a character between 2 parts of the matching pattern in the filename using prename?
我非常接近這個工作,例如這將工作,但是在我插入的 0 字符之前和之后有一個額外的空間。 我不確定如何取出這個空間並仍然正確解析變量。
將“3 - 劇集名稱”重命名為“03 - 劇集名稱”:
find . -type f -name '[[:digit:]] - [[:alpha:]]*' -execdir prename -n 's/(.*\/)(\d - \w.*)/$1 0 $2/g' {} +
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.