Files
mind-palace/cli/zip.md
T
2024-12-01 12:42:18 -08:00

29 lines
716 B
Markdown
Executable File

The basic syntax for the `zip` command is:
```bash
zip [options] zipfile files/directories
```
Common options include:
- `-r`: Recursively include files in directories
- `-q`: Quiet mode (less output)
- `-v`: Verbose mode
- `-u`: Update existing entries if newer
- `-9`: Maximum compression
- `-0`: Store files only, no compression
- `-e`: Encrypt the zipfile with a password
Some common examples:
```bash
# Create a zip archive of multiple files
zip archive.zip file1.txt file2.txt
# Create a zip archive of a directory and all its contents
zip -r archive.zip directory/
# Create an encrypted zip file
zip -e secure.zip confidential.txt
# Add/update files in an existing zip
zip -u archive.zip newfile.txt
```