Sunday, May 5, 2024
4
rated 0 times [  4] [ 0]  / answers: 1 / hits: 8380  / 1 Year ago, tue, march 28, 2023, 7:09:08

I got a zip file like this:


zipfile.zip  
|______ -JWQYBCVAQA=

|_______ text.txt
othergarbage.jpg
othergarbage.deb
othergarbage.whatever

I 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.


More From » command-line

 Answers
0

Don't use a leading slash, and just give the path to the file as the second argument:


unzip zipfile.zip -JWQYBCVAQA=/test.txt

You 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 ''.


[#1577] Wednesday, March 29, 2023, 1 Year  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
hamostic

Total Points: 403
Total Questions: 142
Total Answers: 112

Location: Iceland
Member since Sat, Sep 17, 2022
2 Years ago
;