Forrest logo
back to the zip tool

zip:archive:remove-file

Remove files/directories from a specific archive ([d]elete).
$ zip -d ${path/to/compressed-zip} ${filename_or_directory1 filename_or_directory2 ---}
try on your machine

The command "zip -d" is used to delete files or directories from a compressed zip file.

The "${path/to/compressed-zip}" is the path to the compressed zip file that you want to modify.

The "${filename_or_directory1 filename_or_directory2 ---}" are the file names or directory names that you want to delete from the compressed zip file. You can specify multiple files or directories by separating them with whitespace.

For example, suppose you have a compressed zip file named "mypackage.zip" in the directory "/home/user/Documents" and you want to delete two files "file1.txt" and "file2.txt" from the compressed zip file. The command would be:

zip -d /home/user/Documents/mypackage.zip file1.txt file2.txt

This command will delete the two files "file1.txt" and "file2.txt" from the "mypackage.zip" file.

This explanation was created by an AI. In most cases those are correct. But please always be careful and never run a command you are not sure if it is safe.
back to the zip tool