Created
February 6, 2019 15:41
-
-
Save szepnapot/e70c13f767b2f73e9eeaf6ba88701231 to your computer and use it in GitHub Desktop.
[create flat zip from multi dir] create a zip with multiple files without sub-folders #bash #unix #shortcut
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
zip myfiles d0 | |
(cd f1; zip -u ../myfiles.zip d1) | |
(cd f2/f3; zip -u ../../myfiles.zip d4) | |
# example | |
# zip project3.zip -j a/*.hdl | |
# (cd b; zip -u ../project3.zip *.hdl) | |
# The parentheses create subshells, and the effect of the cd only lasts in the subshell, | |
# so you don't have to cd back to the original directory. | |
# If d1, d2, etc. are actually files and not directories themselves, then use the -j option. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment