我有以下文件夹结构:如何使用bash脚本将所有* .html文件从一个文件夹复制到另一个文件夹?
..
documents
folder_destination // <- here I want to put *.html files
project
scripts
myScript.sh
folder_source
a.html
b.html
c.html
我想写在myScript.sh文件bash脚本, 将所有的* .html文件从folder_source复制到folder_destination。
myScript.sh代码示例:
#!/bin/bash
cd ../folder_source
for f in *.html
do
cp -v "$f" ../../folder_destination/"${f%.html}".html
done
但它不工作
'CP文件/项目/ folder_source/* HTML文档/ folder_destination /'? – 2017-04-12 13:32:22
我可以使用相对路径吗? @Dex'ter – Dmitry