更新时间:2023-11-22 23:37:52
您可以将这个 find
与 sed
一起使用:
You can use this find
with sed
:
cd to /path/of/pdfs
while IFS= read -rd '' line; do
echo mv "$line" $(sed 's~\./[a-zA-Z]*\([0-9]*[a-zA-Z]\).*\(\.pdf\)$~\1\2~' <<< "$line")
done < <(find . -maxdepth 1 -regex '\./[a-zA-Z]*[0-9]*[a-zA-Z]\{1,\}\.pdf$' -print0)
确认其正常运行后,
删除 echo
.
Remove echo
after you verify it is working.