To create a zip archive in Unix or Linux, you can use the zip
command.
The zip
command is a utility that is used to compress and archive files and directories. It creates a single zip file that contains the compressed versions of the specified files and directories.
To create a zip archive, you can use the zip
command followed by the name of the zip file and the list of files and directories that you want to include in the archive. For example:
zip archive.zip file1.txt file2.txt directory1
This will create a zip file named archive.zip
that contains the file1.txt
and file2.txt
files and the directory1
directory.
You can also use the -r
option to include subdirectories recursively. For example:
zip -r archive.zip directory1
This will create a zip file named archive.zip
that contains the directory1
directory and all of its subdirectories.
To add files to an existing zip archive, you can use the -u
option. For example:
zip -u archive.zip file3.txt
This will add the file3.txt
file to the archive.zip
archive.
For more information about the zip
command and its options, you can consult the documentation for your specific Unix or Linux system.