What is the usage of zip in Linux?
In Linux, the zip command is used to compress files and directories into a single zip file for easier transmission or archiving. Here are some common uses of the zip command:
- Compress files or directories:
zip - Compress multiple files or directories into a zip file:
zip - Recursively compress a directory and its contents by using the command:
zip -r - Add a file to an existing zip file:
zip -u - View the contents of a zip file by running the command:
unzip -l - Decompress the zip file:
unzip - Please extract the contents of the zip file to the specified directory by using the command “unzip
-d “. - Exclude specific files or directories during compression:
zip -r-x - Set a password when compressing:
zip -r -e
These are just some common uses of the zip command. More options and parameters can be found by checking the man zip command or typing zip –help in the terminal.