文件扩展名添加到使用bash文件 [英] Add file extension to files with bash
本文介绍了文件扩展名添加到使用bash文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
什么是文件扩展名.JPG添加到扩展名的文件,使用bash的好方法吗?
谢谢,
解决方案
为* .JPG F;做MV$ F$ {F%.JPG}; DONE
对于f *中;做MV$ F,$ f.jpg DONE
What is the good way to add file extension ".jpg" to extension-less files with bash?
Thanks,
解决方案
for f in *.jpg; do mv "$f" "${f%.jpg}"; done
for f in *; do mv "$f" "$f.jpg"; done
这篇关于文件扩展名添加到使用bash文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文