使用命令:zip -qr file.zip ./dist
,打包后解压zip文件,发现自动创建了file文件夹。
有尝试加入 -j
参数,发现打包错误,因为子文件夹中有重名文件。
请问如何做到打包后不自动创建文件夹呢
###cd dist/ && zip a.zip * && mv a.zip ../ && cd ../
懂你的意思,不想打包的压缩文件里有文件夹哈哈哈哈。
###我使用 zip
与 unzip
作为测试,但没有发现你说的情况。
[root@localhost ~]# ls dist/
hello
[root@localhost ~]# zip -qr file.zip ./dist
[root@localhost ~]# ls
dist file.zip
[root@localhost ~]# unzip file.zip -f
Archive: file.zip
[root@localhost ~]# ls
dist file.zip
[root@localhost ~]# ls dist/
hello