我如何批量重命名可以使用终端的文件吗? [英] how can I batch rename files using the Terminal?
本文介绍了我如何批量重命名可以使用终端的文件吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一组文件,它们都 nnn.MP4.mov
我怎么能对其进行重命名,以便它只是 nnn.mov
?
I have a set of files, all of them nnn.MP4.mov
how could I rename them so that it is just nnn.mov
?
推荐答案
首先,运行以下作为一个测试,以查看哪些文件会被重命名为其中:
First, run the following as a test to view which files would be renamed to which:
for file in *.mov
do
echo mv "$file" "${file/MP4./}"
done
如果这一切看起来不错,删除回声
从第三行实际重命名文件。
If it all looks fine, remove the echo
from the third line to actually rename the files.
这篇关于我如何批量重命名可以使用终端的文件吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文