Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有很多包含.c文件的目录。我想.c使用 shell 脚本将不同目录中的所有文件复制到单个目录。
.c
find -name '*.c' -exec cp -t /tmp {} +
/tmp
如果你想避免冲突,你可以添加这个
find -name '*.c' -exec cp --parents -t /tmp {} +
ref