简体   繁体   中英

How to unzip into specific directory without recreate all the path with bash script

In my ios application, I need to unzip an archive that is placed into /var/mobile/Library/Preferences/xxx into, for example, /var/mobile/Library/Preferences/tmp.

My issue is that when I launch this:

unzip /var/mobile/Library/Preferences/xxx/archive.zip -d /var/mobile/Library/Preferences/tmp/

in the tmp folder, there is all the archive path: /var/mobile/Library/Preferences/tmp/var/mobile/Library/Preferences/xxx/archive/...

How could I do for only have /var/mobile/Library/Preferences/tmp/archive/... and not all the archive path into the target directory ?

Thanks in advance

尝试使用-j选项unzip将目录结构展平并将所有文件写入当前目录。

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