0
我想複製一個文件中都存在,其中一個腳本文件中所有子目錄我想其中一個腳本文件中所有子目錄
我試過這個命令存在複製文件
find . -type f -regex '.*.sh' -exec echo cp myfile.txt {} \;
輸出是
cp myfile.txt ./b/e/e.sh
cp myfile.txt ./a/a.sh
cp myfile.txt ./c/f/f.sh
cp myfile.txt ./c/c.sh
我所要的輸出是
cp myfile.txt ./b/e
cp myfile.txt ./a
cp myfile.txt ./c/f
cp myfile.txt ./c
我該如何改變find命令的輸出來實現這個功能?
感謝
爲什麼你需要的輸出忽略'f.sh'和'C .sh'? –
我不想忽視它們,但我沒有用f.sh和c.sh寫這兩行,抱歉讓我感到困惑。 – naren
@WilliamPursell,我現在編輯了這個問題。 – naren