僅替換 xhtml 文件

僅替換 xhtml 文件

使用此命令,我複製不同的檔案並將其替換到目標位置。

rsync -av --existing web/src/main/webapp/com/* web/target/project/com/

如何僅替換具有.xhtml擴展名的檔案?

答案1

在您的命令中*,將擴展到“src”目錄中的任何類型的文件,這意味著所有這些文件(甚至是目錄),*.xhtml您只能定位具有.xhtml擴展名的文件。

rsync -av --existing web/src/main/webapp/com/*.xhtml web/target/project/com/

使用此命令僅更新xhtml擴展名為 in 的 檔案。web/target/project/com/

相關內容