0

I have zipped file that contains multiple files and folders:

-$PlcLogic$/Application/Application.app 
-$PlcLogic$/Application/Application.crc
-$PlcLogic$/meta.info

After extracting with unzip on bash, Linux throws away the folder hierarchy and creates a simple file without keeping the folder structure prior unzipping.

Output from ls -l after unzipping is:

-$PlcLogic$\Application\Application.app
-$PlcLogic$\Application\Application.crc
-$PlcLogic$\meta.info

The problem are the $'s which we are not able to change as it gets created from a different software. Any idea how to keep the folder hierarchy here?

jonko
  • 11
  • Can you add more detail to your question please? I suspect you have a zip file that uses winows path separators `\`, but that isn't 100% clear. Run `unzip -l` on the zip file to show us what exactly if in it. Also, for the output from unzipping, run `find` to show us the output directory hierarchy. Finally, what program did you use to create the zip file (include the command line of possible). – pmqs Jun 25 '20 at 07:36
  • Unzip -l outputs me the same as it actually is after unzipping: Archive: backup.zip Length Date Time Name --------- ---------- ----- ---- 200 2020-05-04 12:16 meta.info 355664 2020-05-04 12:16 $PlcLogic$\Application\Application.app 20 2020-05-04 12:16 $PlcLogic$\Application\Application.crc --------- ------- 355884 3 files find gives me too many results for here to show. I used codesys and created a backup of my project. Thanks – jonko Jun 29 '20 at 06:23
  • You have an invalid zip file that is using windows path separators. To fix see https://unix.stackexchange.com/questions/166159/convert-a-windows-created-zip-to-linux-internal-paths-issue and https://superuser.com/questions/544786/unrar-creating-files-with-backslashes-in-names-instead-of-proper-directory-hiera/1328762#1328762 – pmqs Jun 29 '20 at 08:19
  • Thanks, that actually helped! – jonko Jun 30 '20 at 09:12

0 Answers0