如何tar特定文件扩展名的文件?
How to tar specific file extension files?
我有文件类型 .cpp,.h,.o,.so,*.a
我只需要 tar *.cpp 和 .h 文件。
截至目前,我正在使用 --exclude=.{o,so,a} 不需要的文件到 tar。
但如果我有很多不需要的扩展,排除列表就会变得非常大。
将特定文件扩展名包含到 tar 的命令是什么?
find -name "*.h" -o -name "*.cpp" | xargs tar -czvf build.tar.gz
我有文件类型 .cpp,.h,.o,.so,*.a 我只需要 tar *.cpp 和 .h 文件。 截至目前,我正在使用 --exclude=.{o,so,a} 不需要的文件到 tar。 但如果我有很多不需要的扩展,排除列表就会变得非常大。 将特定文件扩展名包含到 tar 的命令是什么?
find -name "*.h" -o -name "*.cpp" | xargs tar -czvf build.tar.gz