Yanıtlar:
Dizinin tamamını istiyorsanız, -ranahtarı kullanabilirsiniz :
zip -r -s 200M myzip photos_test
Buna photos_testrağmen tüm alt dizinleri içerecektir .
find photos_test/ -mindepth 1 -maxdepth 1 | zip -@ -s 200M
find . -mindepth 1 -maxdepth -name '*.json' | zip {YOURZIPFILENAME}.zip -@sen bölünmüş gerekiyor ve uzantısı tarafından dosyaları seçmek için istemiyorsanız.
ls photos_test | zip -s 200M -@ photos
-@zip dosyasının stdin'den bir dosya listesini okumasına neden olur|boru arasındaki bir çıkış bölgesinin lsiçine girişi arasında zipkomutman zip:
USE ⋮ -@ file lists. If a file list is specified as -@ [Not on MacOS], zip takes the list of input files from standard input instead of from the command line. For example, zip -@ foo will store the files listed one per line on stdin in foo.zip. Under Unix, this option can be used to powerful effect in conjunction with the find (1) command. For example, to archive all the C source files in the current directory and its subdirectories: find . -name "*.[ch]" -print | zip source -@ (note that the pattern must be quoted to keep the shell from expanding it). ⋮
-bash: /usr/bin/zip: Argument list too longşu durumda olabilir: 1--ranahtar kullanmadığı için , 2- arşivlemek için çok fazla dosya var. İlk durumda @ Mat'ın cevabı doğrudur ve ikinci durumda @ IgnacioVazquez-Abrams'ın cevabı doğrudur.