Skip to content

Instantly share code, notes, and snippets.

@szepnapot
Created February 6, 2019 15:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save szepnapot/e70c13f767b2f73e9eeaf6ba88701231 to your computer and use it in GitHub Desktop.
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
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