zip Command: Tutorial & Examples
zip command in Linux is a command-line utility that is used to create, modify, and extract archive files in the ZIP format. The basic syntax for creating a zip archive
zip [options] archive_name file1 file2 file3...
When you run the
zip command followed by an archive name and a list of files or directories, it will create a new archive file with the specified name and compress the specified
files or directories into that archive.
For example, if you want to create a zip archive of the files
file3.txt and name it
archive.zip, the command would
zip archive.zip file1.txt file2.txt file3.txt
zip command also has several options that can be used to modify the behavior of the command, such as:
-roption to recursively compress all files in a directory
-9option to compress files using maximum compression level
-uoption to update an existing archive
-doption to delete files from an archive
-voption to display the progress of the compression
unzip command can be used to extract archive files in the ZIP format.
unzip are commonly used to compress and
extract files on Linux systems, they are widely supported and can be used to compress and extract files in a cross-platform manner.