[root@hf-01 d6z]# mkdir -p /tmp/hf/han/hanfeng
[root@hf-01 d6z]# cd /tmp/hf
[root@hf-01 hf]# touch 1.txt
[root@hf-01 hf]# touch /tmp/hf/han/wu.txt
[root@hf-01 hf]# touch /tmp/hf/han/hanfeng/66.txt
[root@hf-01 hf]# cd /tmp/d6z
[root@hf-01 d6z]# ls /tmp
12.txt 1.txt 2.txt.bz2 d6z ha.txt.xz hf mysql.sock vim.txt
[root@hf-01 d6z]# cp -r /tmp/hf .
[root@hf-01 d6z]# ls
1.txt 4.txt 5.txt 8.xt hf
[root@hf-01 d6z]# tree hf/
hf/
├── 1.txt
└── han
├── hanfeng
│ └── 66.txt
└── wu.txt
2 directories, 3 files
[root@hf-01 d6z]# cp 1.txt hf/han/hanfeng/
[root@hf-01 d6z]# du -sh hf/
1.5M hf/
[root@hf-01 d6z]# zip 1.txt.zip 1.txt
adding: 1.txt (deflated 74%)
[root@hf-01 d6z]# du -sh 1.txt.zip
388K 1.txt.zip
[root@hf-01 d6z]# ls
1.txt 1.txt.zip 4.txt 5.txt 8.xt hf
[root@hf-01 d6z]# zip -r hafe.zip 8.txt hf
zip warning: name not matched: 8.txt
adding: hf/ (stored 0%)
adding: hf/han/ (stored 0%)
adding: hf/han/hanfeng/ (stored 0%)
adding: hf/han/hanfeng/66.txt (stored 0%)
adding: hf/han/hanfeng/1.txt (deflated 74%)
adding: hf/han/wu.txt (stored 0%)
adding: hf/1.txt (stored 0%)
[root@hf-01 d6z]# ls
1.txt 8.txt hf hafe.zip
zip压缩文件后不删除之前的文件
[root@localhost d6z]# unzip yasuo.zip
Archive: yasuo.zip
replace 2.txt? [y]es, [n]o, [A]ll, [N]one, [r]ename: A
inflating: 2.txt
extracting: hf/han/hanfeng/66.txt
inflating: hf/han/hanfeng/1.txt
extracting: hf/han/wu.txt
extracting: hf/1.txt
extracting: hf/11.txt
[root@localhost d6z]#
[root@localhost d6z]# mkdir lala
[root@localhost d6z]# unzip 1.txt.zip -d lala/
Archive: 1.txt.zip
inflating: /lala/1.txt
[root@localhost d6z]# unzip -l yasuo.zip
Archive: yasuo.zip
Length Date Time Name
--------- ---------- ----- ----
1283485 11-09-2017 16:02 2.txt
0 11-10-2017 10:40 hf/
0 11-10-2017 10:41 hf/han/
0 11-10-2017 10:45 hf/han/hanfeng/
0 11-10-2017 10:41 hf/han/hanfeng/66.txt
1283485 11-10-2017 10:45 hf/han/hanfeng/1.txt
0 11-10-2017 10:41 hf/han/wu.txt
0 11-10-2017 10:40 hf/1.txt
0 11-10-2017 10:40 hf/11.txt
--------- -------
2566970 9 files
[root@localhost d6z]#