Pack and compress files on the command line with the ubiquitous zip tool and learn practical options for everyday Linux work. 03.06.2026 | reading time: 3 min When files must be moved, shared or stored, the `zip` command packs them into a single compressed archive; this short guide shows how to create, inspect and manage zip archives on Linux with hands-on examples. Create an archive in seconds Follow along and create a tiny archive now: ```bash mkdir demo_zip cd demo_zip echo Hello > file1.txt echo World > file2.txt zip -r ../demo.zip . # example output from zip adding: file1.txt (stored 0%) adding: file2.txt (deflated 40%) # inspect the result ls -lh ../demo.zip -rw-r--r-- 1 user user 1.2K Jun 03 12:00 ../demo.zip ``` Options that change everything Use `-r` to recurse into directories and `-9` for maximum compression; exclude files with `-x`, update existing archives with `-u`, and use `-@` to read filenames from stdin so `find` can feed names; encrypt with `-e` (note: this uses weak ZipCrypto), test archives with `-T`, and move files into the archive with `-m` to delete originals after adding. Combine zip with other tools Zip shines in pipelines: for selective archiving run `find . -name '*.log' -print | zip logs -@`, or script nightly packs with a cron job; for strong encryption layer `gpg` over the archive or prefer `7z` for modern encryption and compression ratios when security or size matters. Know the limitations Zip is fast and widely supported, but it does not preserve all Unix metadata such as ownership, special device files, or SELinux labels; for full-system backups prefer `tar` with a compression stream (for example `tar` plus `xz`) and avoid relying on zip for exact metadata replication. Wrap-up and next steps Zip is a practical tool for everyday packaging, but understanding when to use it versus tools like tar or 7z is crucial; deepen Linux skills and consider pursuing certifications such as CompTIA Linux+ or LPIC-1, and for focused exam preparation explore bitsandbytes.academy as an intensive resource. Join Bits & Bytes Academy First class LINUX exam preparation. utilities backup storage scripting