Thursday, June 4, 2015

console - 7-Zip command line to extract a folder from an archive



I'm using the 7-Zip commandline to extract a ZIP archive called abc.zip which is an archive with a folder called 'zipper' with three text files in it (a.txt, b.txt, and c.txt).



My problem is when I extract it with the following command:



7z e C:\abc\abc.zip -y oC:\abc



7-Zip extracts everything, but it doesn't extract the folder 'zipper', it just extracts a.txt, b.txt and c.txt and puts them in the output destination (that is, C:\abc).



How can I make 7-Zip just extract the actual folder?


Answer



You need to use 7z x archive.zip to extract with full paths. See: http://sevenzip.sourceforge.jp/chm/cmdline/commands/extract_full.htm


No comments:

Post a Comment

linux - How to SSH to ec2 instance in VPC private subnet via NAT server

I have created a VPC in aws with a public subnet and a private subnet. The private subnet does not have direct access to external network. S...