この質問は、例えば説明するのが最も適していると思います。
/home
test1.txt
test2.txt
/home/my-folder
test3.txt
test4.txt
test1.txt
、test2.txt
そしてmy-folder
その中にあるフォルダ/home
。test3.txt
そしてtext4.txt
内部/home/my-folder
。
フォルダのすべての内容をコピーしたいのですが、/home
その中にある2つのファイルを除外したいと思います(test3.txt
およびtest4.txt
)my-folder
。
これを行うにはどうすればよいですかcp
?
rsync
試してみましたが、時にはrsync
サーバーにインストールされておらず、ソフトウェアをインストールする権限がないため、これが可能であることがわかります。
ベストアンサー1
find(1)
以下を使用してこれを実行できますcpio(1)
。
find /home -path './my-folder/test[34].txt' -prune -o \( -type f -print \) | \
cpio -pdamv /some/other/dir