Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

When I use the unzip command from Linux machine and the files under ZIP already exists on my local directory, I get the interactive question: (if I want to replace the files from the ZIP with the existing files on my Linux machine

How to use the unzip command without this interactive question?

 [@superuser]# ls -ltr

 total 0
 -rw-r--r--    1 root     root            0 Nov 15 15:13 all_my_files1
 -rw-r--r--    1 root     root            0 Nov 15 15:13 all_my_files2

[@superuser]# unzip MY_FILES.zip

    Archive:  MY_FILES.zip
    replace all_my_files1.txt? [y]es, [n]o, [A]ll, [N]one, [r]ename: A
        inflating: all_my_files1.txt  
        inflating: all_my_files2.txt  
share|improve this question

2 Answers 2

up vote 8 down vote accepted

As the unzip(1l) man page states, pass -o to unzip in order to force overwriting of existing files without prompting.

share|improve this answer

You want the -o option:

unzip -o MY_FILES.zip

Source

overwrites existing files without prompting. This is a dangerous option, so use it with care. (It is often used with -f, however.)

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.