Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how do I extract 7-zip zip file without directory

Tags:

zip

7zip

I have this command:

7z e -oD:\Data\ODS_Source\* D:\Data\DATA_DROP\Source.zip

This results in D:\Data\ODS_Source\Source\<files>.<ext>

I need D:\Data\ODS_Source\<files>.<ext>

How do I eliminate the folder creation?

Thanks.

like image 418
arcee123 Avatar asked Sep 22 '16 00:09

arcee123


2 Answers

Try this instead:

7z e -oD:\Data\ODS_Source D:\Data\DATA_DROP\Source.zip

like image 121
BlackBeard Avatar answered Oct 23 '22 21:10

BlackBeard


  # extract with sub-dirs to ./tn
  7z x -otn lc-3.39.0.zip
  # move to . skipping ./tn/<junk_root>/*
  mv tn/**/* .
  # remove empty ./tn
  rm -rf tn

incidentally does this unscrupulously per all root (assumed) junk dirs

like image 1
Zaira Avatar answered Oct 23 '22 21:10

Zaira