Is there a way to zip all files in a given directory with the zip command? I've heard of using *.*, but I want it to work for extensionless files, too.
|
|
||||
|
You can just use Note that Alternatively,
where myfiles is the directory containing your files. Note that the produced zip will contain the directory structure as well as the files. As peterph points out in his comment, this is usually seen as a good thing: extracting the zip will neatly store all the extracted files in one subdirectory. You can also tell zip to not store the paths with the The |
|||||||||||||
|
|
Another way would be to use find and xargs: (this might include a "." directory in the zip, but it should still extract correctly. With my test, zip stripped the dot before compression)
(The This will by default include all sub-directories. On GNU find |
||||
|
|

zip myarch.zip mydir/*? – Joseph R. Nov 28 '12 at 16:46