# Problem with zip command..

**URL:** <https://community.unix.com/t/problem-with-zip-command/249652>\
**Category:** UNIX for Dummies Questions & Answers\
**Created:** [September 20, 2009, 12:55pm UTC](https://community.unix.com/t/problem-with-zip-command/249652 "2009-09-20T12:55:49Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![ks\_reddy](https://community.unix.com/letter_avatar/ks_reddy/32/6_449c533f586939b6e5f246632a46421f.png) [@ks\_reddy](https://community.unix.com/u/ks_reddy)\
**Post date:** [September 20, 2009, 12:55pm UTC](https://community.unix.com/t/problem-with-zip-command/249652/1 "2009-09-20T12:55:49Z")

</div>

Hi friends

```
I am working in cygwin. Currently I am in root directory\(C\). I want to zip only the files from a diretory "A" to a new directory 1.zip in root directory C.

```

I am using the following command:  
$: zip 1.zip A/\*  
but it is zipping the entire directory itself, But what I want is when I unzip 1.zip I should get  
file1  
file2 etc...  
instead of  
A/file1  
A/file2 etc..  
I really appreciate your help if you can help me in modify the above command so that I can get one of my script done on 100's of directories like A.

Thanks in advance..

---

<div class="post-metadata">

**Author:** ![Scrutinizer](https://community.unix.com/user_avatar/community.unix.com/scrutinizer/32/1216_2.png) [@Scrutinizer](https://community.unix.com/u/Scrutinizer)\
**Post date:** [September 20, 2009, 1:43pm UTC](https://community.unix.com/t/problem-with-zip-command/249652/2 "2009-09-20T13:43:29Z")

</div>

```nohighlight
cd A
zip 1.zip *

```

---

<div class="post-metadata">

**Author:** ![ks\_reddy](https://community.unix.com/letter_avatar/ks_reddy/32/6_449c533f586939b6e5f246632a46421f.png) [@ks\_reddy](https://community.unix.com/u/ks_reddy)\
**Post date:** [September 21, 2009, 7:49am UTC](https://community.unix.com/t/problem-with-zip-command/249652/3 "2009-09-21T07:49:23Z")

</div>

Hi Scrutinizer,

I want the command to work with out doing cd to the respective directory I am interested. I mean I don't want to use cd A . I hope you understood my problem.

---

<div class="post-metadata">

**Author:** ![pludi](https://community.unix.com/user_avatar/community.unix.com/pludi/32/1278_2.png) [@pludi](https://community.unix.com/u/pludi)\
**Post date:** [September 21, 2009, 8:27am UTC](https://community.unix.com/t/problem-with-zip-command/249652/4 "2009-09-21T08:27:43Z")

</div>

```nohighlight
zip -j 1.zip A/*

```

'man zip' is a useful resource too.

---

<div class="post-metadata">

**Author:** ![ks\_reddy](https://community.unix.com/letter_avatar/ks_reddy/32/6_449c533f586939b6e5f246632a46421f.png) [@ks\_reddy](https://community.unix.com/u/ks_reddy)\
**Post date:** [September 23, 2009, 6:28am UTC](https://community.unix.com/t/problem-with-zip-command/249652/5 "2009-09-23T06:28:23Z")

</div>

Thanks Pludi,

```
It worked very well. I regret to my innocence and negligence for not looking deep into the zip command manual.
```
