Home > OS >  zip the files and folders inside a parent directory without including the parent directory Amazon
zip the files and folders inside a parent directory without including the parent directory Amazon

Time:02-08

Is there a Linux command to zip the files and folders inside a parent directory without including the parent directory. From all the solutions that I tried, the parent directory also is getting zipped

CodePudding user response:

Move into the folder, then zip :

cd my-folder
zip -r ../my-archive.zip *

Dirty, but effective

Or, in a more fancy way, using tar:

tar czf my-archive.tar.gz -C /path/to/my-foder/ ./
  •  Tags:  
  • Related