I have a folder containing 100 ZIP files. Each ZIP contains PDF files such as file.pdf, other_file.pdf, and so on.
I need to unzip these PDFs into a single folder called 'combined'. I have a script that works, but the problem is that some PDFs have the same name in different ZIP files. When this happens, the terminal asks me to manually rename each one.
To automate this, I need to rename the PDF files by appending a number to the end of each filename, like this: file-1.pdf, file-2.pdf, other_file-3.pdf, other_file-4.pdf and so on.
My code:
mkdir combined
unzip '*.zip' -d combined