简体   繁体   中英

how to zip particular folders in linux using shell

Let say we have a directory structure like:

A
|---B
|   |---C
|   |   |--f1.txt
|   |
|   |---D
|   |   |--f2.txt
|
|---E
|   |---f3.txt
|   |
|
|---F
|   |---f4.txt

Now how to zip a file BE.zip excluding F directory, ie when I unzip BE.zip the result should be:

|---B
|   |---C
|   |   |--f1.txt
|   |
|   |---D
|   |   |--f2.txt
|   
|---E
|   |---f3.txt

好的,我知道了..

zip -r BE.zip B/ E/

you can u this for recursive

zip BE.zip B/* E/*

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM