I got a zip file like this:
zipfile.zip |______ -JWQYBCVAQA= |_______ text.txt othergarbage.jpg othergarbage.deb othergarbage.whateverI only need to extract text.txt
i tryed: unzip Externo.zip -x '/-JWQYBCVAQA=/behavior_packs' '/-JWQYBCVAQA=/db' '/-JWQYBCVAQA=/resource_packs' '/-JWQYBCVAQA=/level.dat' '/-JWQYBCVAQA=/level.dat.old' '/-JWQYBCVAQA=/world_icon.jpeg'
But it outputs that there is no files with those names
I don't know how to do this , any help is apreciated.
1 Answer
Don't use a leading slash, and just give the path to the file as the second argument:
unzip zipfile.zip -JWQYBCVAQA=/test.txtYou can also use wildcards:
unzip zipfile.zip '*/test.txt' For files/directories whose names start with -d or -x (which are the options allowed after the zip filename), to escape them you can prefix with \\ (\ for unzip itself, and the extra escape for the shell) or '\'.