我有一个find如下的命令列出了匹配的文件:
$ find . -type f -name "*.txt"
./level2/file2.txt
./level2/level3/file3.txt
./level2/level3/level4/file4.txt
./level2/level3/level4/level5/file5.txt
./output.txt
Run Code Online (Sandbox Code Playgroud)
现在我尝试通过链接将每个列出的文件复制到特定文件夹exec:
$ ls copy_here | wc -l
0
$ find . -type f -name "*.txt" -exec cp {} ./copy_here \;
cp: ./copy_here/file2.txt and ./copy_here/file2.txt are identical (not copied).
cp: ./copy_here/file3.txt and ./copy_here/file3.txt are identical (not copied).
cp: ./copy_here/file4.txt and ./copy_here/file4.txt are identical (not copied).
cp: ./copy_here/file5.txt and ./copy_here/file5.txt are identical (not copied).
Run Code Online (Sandbox Code Playgroud)
任何人都可以帮助分解执行顺序以帮助更好地理解执行流程吗?