Answer the question
In order to leave comments, you need to log in
Linux: How to unzip an archive into a folder with the same name as the archive?
Hello,
I decided to unpack several zip archives into folders with the same names as the archives using unzip.
Expecting that the archiver does this by default, I entered the command:
unzip \ * .zip
but in the end all the files began to be unpacked into one folder, followed by questions and replacing files with the same name.
This situation is not described in man'e. How to unpack all archives into folders with the same names as the archives, is it possible to do this using unzip tools without writing scripts?
UPD#1:
Is there a patch to solve this problem?
Answer the question
In order to leave comments, you need to log in
The zip itself can not do this, and the saddest thing is that if there are more than 1 files, then this is a cycle, and here there is already a rather complicated construction.
in general it is somewhere like that.
or so I
tried to throw something on the wall, but in any case, you have to write a regular program, then use cut.
In general, you need to make a sh file ;(
Alternatively, in MS, you can add a snippet with it to the menu, then unpacking in it will work exactly like this.
I'll add that sort() by default sorts values as strings.
https://developer.mozilla.org/en/docs/Web/JavaScri...
Define your comparator for numbers[1, 2, 10].sort(function(a,b){return a-b;})
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question