Linux unzip command: Option to force overwrite

command linelinuxzip

I am writing a shell script that unzips a ZIP file into an existing hierarchy of files, potentially overwriting some of the files.

The problem is that the unzip command asks for confirmation:
replace jsp/extension/add-aspect.jsp? [y]es, [n]o, [A]ll, [N]one, [r]ename: y

Is there an option to force unzip to overwrite the files?

Best Answer

According to http://www.manpagez.com/man/1/unzip/ you can use the -o option to overwrite files:

unzip -o /path/to/archive.zip

Note that -o, like most of unzip's options, has to go before the archive name.

Related Question