Reputation: 437
For example, current directory is /A/B/
, some scripts whose suffixes are .py
and .sh
in /A/B/C/
,/A/B/C/D/
and /A/B/E/
.
How to generate such a compressed file which has the structure of directories and contains the python /shell scripts?
Upvotes: 1
Views: 223
Reputation: 8137
Use find with your compression, e.g.:
zip outfile -r `find . -name '*.py'` `find . -name '*.sh'`
Upvotes: 1
Reputation: 256
find ./someDir -name ".php" -o -name ".html" | tar -cf my_archive -T -
as seen here in a question very similar to yours. How to tar certain file types in all subdirectories?
Upvotes: 1