I want just stupid, simple thing. ZIP all the content of given directory.
What I get as result of:
zip -r /home/andi/MEDIA_DUMPS/xyz_media.zip /home/andi/xyz/mega_backend/mega_www/media
Is following:
➜ home tree -L 5
.
└── andi
└── xyz
└── mega_backend
└── mega_www
└── media
├── csv
├── editor
└── img
while I want just this:
➜ media tree -L 1
.
├── csv
├── editor
└── img
MY AD-HOC WAY AROUND USING TAR:
tar -cjf /home/andi/MEDIA_DUMPS/xyz_media.tar.gz -C /home/andi/xyz/mega_backend/mega_www/media .
Best Answer
How do I to zip only files and not the whole directory structure?
Use the
-j
(junk-paths) option.zip: Package and compress (archive) files
...
Source zip: Package and compress (archive) files: