I have a big zip archive and I want to extract only .mp3 files that are located in sites/default/files/ to mymp3 directory. How can I achieve it?
Asked
Active
Viewed 169 times
1
Jeff Schaller
- 66,199
- 35
- 114
- 250
Yuseferi
- 370
- 3
- 6
- 15
-
@DopeGhoti I didn't try anything if you know how can I do it please provide your answer, extract `sites/default/files/*.mp3` files form zip file – Yuseferi Feb 26 '16 at 07:14
-
http://unix.stackexchange.com/questions/14120/extract-only-a-specific-file-from-a-zipped-archive-to-a-given-directory – Panther Feb 26 '16 at 07:40
-
@bodhi.zazen you just search the google and paste it here ? :D , read the question first please, files not file ;) – Yuseferi Feb 26 '16 at 07:55
1 Answers
3
I found the solution, you can do it with
unzip yourzipfile.zip 'sites/default/files/*.mp3' -d mymp3
Gilles 'SO- stop being evil'
- 807,993
- 194
- 1,674
- 2,175
Yuseferi
- 370
- 3
- 6
- 15
-
1You better put the filename wildcard into quotes, else you'll get problems if an mp3 already exists in the local path. – Murphy Feb 26 '16 at 12:25