1. 程式人生 > >Cygwin踩坑記錄(三)-tar命令解壓.zip檔案提示“gzip: stdin has more than one entry--rest ignored”

Cygwin踩坑記錄(三)-tar命令解壓.zip檔案提示“gzip: stdin has more than one entry--rest ignored”

當我從Activiti6.0 GitHub上下載下來.zip的原始碼的時候,打算用tar命令解壓檔案

結果報錯提示:

            

造成錯誤的原因是因為tar的底層間接呼叫了gzip,而gzip的使用是有限制的:Files created by zip can be uncompressed by gzip only if they have a single member compressed with the 'deflation' method,也就是說單檔案用deflation壓縮的包(.tar結尾的壓縮包)才可以用gzip做解壓操作。

解決辦法:使用unzip做解壓操作。

unzip語法:

     unzip [-Z] [-opts[modifiers]] file[.zip] [list] [-x xlist] [-d exdir]

示例:

    unzip apache-tomcat-8.0.53.zip -d /home/user/code

注:-d為指定輸出資料夾,不指定就是解壓到當前資料夾。