1

I want to zip a directory not everything in the path. I know the command zip -r squash.zip dir1 From the post: How do I zip/unzip on the unix command line?

But when I run the command using the absolute path:

zip -r squash.zip /path/to/dir1

Zip creates folders to the path also and I get in the zip folder /path/to/dir1. What I want is only dir1\sub\dirs

Whitecat
  • 300

1 Answers1

2

it's best to navigate to that specific directory parent and run the zip from there and then store the zip somewhere else. e.g. cd /path/to

zip -r /home/user/dir1.zip dir1/

Laywah
  • 66