问题描述:比如文件夹的名称:1.html,2.html,3.html……500.html,里面的文件名称都是index.html,需要的实现的功能是把index.html的名称改成它外面的文件名称1.html
具体实现代码:
//在当前文件夹打开终端 for dir in *.html; do if [ -d "$dir" ]; then cd "$dir" mv -v index-https.html "$dir" cd .. fi done
问题描述:比如文件夹的名称:1.html,2.html,3.html……500.html,里面的文件名称都是index.html,需要的实现的功能是把index.html的名称改成它外面的文件名称1.html
具体实现代码:
//在当前文件夹打开终端 for dir in *.html; do if [ -d "$dir" ]; then cd "$dir" mv -v index-https.html "$dir" cd .. fi done