A
A
Alexander Nazarov2017-03-27 23:56:22
linux
Alexander Nazarov, 2017-03-27 23:56:22

Unzip unzip on linux?

Tell me how to unpack the "zip" archive using ssh with the obligatory replacement of files, if any are already present in the directory.
I am using this code:

$exec = "sudo -u s" . $row["sid"] . " unzip -o -u " . $addon . ".zip -d " . $addons["dir"] . " && rm -Rf " . $addon . ".zip;";

If there are files on the partition, it does not replace them.
I read mana about unzip , I did not find the necessary key, tell me, who knows.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Maxim Moseychuk, 2017-03-28
@wergio

unzip -o
the parameter -uis not needed
Xs how did you read the mana

-o overwrite existing files without prompting. This is a dangerous option, so use it with care. (It is often used with -f, however, and is the only way to overwrite directory EAs under OS/2.)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question