I have been trying for some time and believe I am fairly close to this, but I am fairly new to Unix so have been finding this difficult.
I have a folder, containing many folders, some of which have zip files in them, some which don't. I am trying to unzip all of the zip files in any sub directories in place.
For example I have:
files/A/something.java
files/B/somezipfile.zip
files/C/someotherfile.zip
files/D/AnotherZipFile.zip
I would like to unzip them (assuming the zips contain just .java files), to have a result like: files/A/something.java
files/B/javafile.java
files/C/someotherfilefromzip.java
files/D/Anotherfile.java
I don't mind if the ZIP files remain or are deleted after unzipping, either is fine.
What I have tried so far.
I expected I could use piping, which I am new to, like this:
find . -name *.zip | unzip
This doesn't work.
I spent some time searching, the closest I got using a solution online is:
find . -name '*.zip' -exec unzip '{}' ';'
This unzips, but unzips them into the current working directory, I wanted them to unzip in place. I also don't understand this command which I would like to as I am trying to learn.