force unzip to also delete any missing files

Posted by Magnus on Super User See other posts from Super User or by Magnus
Published on 2013-06-25T21:41:42Z Indexed on 2013/06/25 22:23 UTC
Read the original article Hit count: 293

Filed under:
|

Currently when I unzip into a directory with pre-existing files, I sometimes unzip an archive to update the files, using -f or -u or -o to overwrite any clashes.

However I would like the unzip process to also delete any files which were not part of the archive, so that the unzipped version fully matches what was in the zipped archive. (Why not just replace the directory then with a fresh unzip? Because I still want to preserve .svn files, just wipe everything else)

© Super User or respective owner

Related posts about zip

Related posts about unzip