I want to use the zip command to create a .ZIP of a folder but only include .txt files.
Subdirectory structure should be preserved!
If you're certain that none of the filenames will contain a newline then you can use find as explained in the zip(1) man page.
find some/dir -type f -name '*.txt' -print | zip ... -@ ...
Sign up using Google
Sign up using Facebook
Sign up using Stack Exchange
By posting your answer, you agree to the
terms of service.
1 year ago