Quantcast
Channel: Command line zip everything within a directory, but do not include any directory as the root - Stack Overflow
Viewing all articles
Browse latest Browse all 5

Answer by Jonny for Command line zip everything within a directory, but do not include any directory as the root

$
0
0

Stumbled across this answer but didnt want to have to change in out of directories. I found the -j option useful which adds all files to the root of the zip. Note that its is all files so subdirectory structure will not be preserved.

So with this folder structure:

MyFolder - MyFile1 - MySubFolder   - MyFile2

And this command:

zip -rj MyFolder.zip MyFolder

You get this:

MyFolder.zip - MyFile1 - MyFile2

Viewing all articles
Browse latest Browse all 5

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>