Session and utilities

The zip command

Creates .zip compressed archives, the format most compatible with Windows, macOS and almost any program.

Syntax

zip [-r] archivo.zip fichero...

Most useful options

-rIncludes folders recursively
-9Maximum compression
-eEncrypts with a password

Copy-ready examples

$ printf 'hola\n' > f.txt && zip p.zip f.txtCreate a .zip

You can try them in the browser terminal: it does not touch your computer.

Typical mistakes

  • Unlike gzip, zip bundles several files into one.
  • Classic zip encryption is weak; for sensitive data use other tools.

Related commands

FAQ

Why use zip instead of tar.gz?

Because the Windows recipient opens it without installing anything.

Learn to actually use it

The basic Linux course takes you from zero to console fluency with 24 self-grading lessons.

Start the free course