我有以下文件夾結構:如何使用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