zip

zip creates and extracts ZIP archives, compresses or expands single-file GZIP streams, lists contents, tests integrity and controls compression level.

ArchivesVersion 1.2.3Stable
lil-terminal

Overview

Use ZIP for compressed directory trees and GZIP when only one file needs compression. Inspect or test before extraction, keep overwrite explicit with -f, and use -d only when the source should be removed after successful creation.

ZIP packs trees; GZIP compresses one file

ZIP can contain many files and directories. GZIP contains one compressed data stream, so zip <file> -gz is not a second archive tree. Both formats use the same safe path and conflict rules where those rules apply.

Syntax

lil-terminal
zip <src|arc.zip|file.gz> [dst] [options]

Reference

zip <src> [dst]

create a ZIP archive

zip <arc.zip> [dst]

extract a ZIP archive into the current directory or <dst>

zip <file.gz> [dst]

decompress GZIP into the current directory or <dst>

-l

list archive information without extracting

-t

test archive paths and data integrity

-gz

compress one file as GZIP

-f

replace an archive or existing extracted files

-d @del

delete the source after successful archive creation

-0 .. -9

set the compression level (default 6)

Archive inspection

-l reads the manifest without extracting data. ZIP entries are rendered as structured path/type/size rows; -t checks safe paths and reads the file streams to detect malformed content. GZIP inspection reports compressed and original sizes when available.

Compression level

-0 stores ZIP entries without DEFLATE compression. -1 through -9 select progressively stronger compression where supported; 6 is the default. The same numeric range is passed to zlib for GZIP.

Extraction safety

Before extraction, paths are normalized and absolute paths, parent traversal, duplicate destinations and symbolic-link entries are rejected. Existing output is preserved unless -f is explicit. -d is valid only during archive creation and invokes del after the archive is finalized successfully.

Interactive sandbox preview

Run the prepared examples directly on the page. Their results are prebuilt and shown in the browser; no terminal command is executed on the server.

Create a ZIP archive

Install and manage

Install the current compatible version. Choose Base for the complete feature set or Minimum for the reduced package; use upgrade to update a module that is already installed.

Base and Minimum are two packages of the same current module release, not separate command versions.

Base package

Install the complete package with local command reference and every published mode.

install zip
Minimum package

Install the reduced package. Local reference is omitted; help <cmd> -i opens the current server reference.

install zip -m
Exact public version

Install exactly this published version.

install zip -v 1.2.3
Check or update

Ask upgrade to check compatibility and replace the installed block only when needed.

upgrade zip
Remove module

Remove the extension block while leaving the core and unrelated modules intact.

install zip -u

Examples

Examples are copyable command lines, not actions executed by this website. Review paths, permissions and destructive flags before running them on a real project.

Create a ZIP archive
cd \sandbox | zip my | cd .
my/
  1.txt
  2.txt
  data/
  test.txt
my.zip
Zip · list
zip tmp/my.zip -l
my/1.txt       file · 0 B
my/2.txt       file · 0 B
my/123.jpg     file · 37.4 KB
Zip · test
zip tmp/my.zip -t
Status   Archive OK
Entries  7
Files    5
Extract a ZIP archive into the current directory or <dst>
zip tmp/my.zip tmp/unpacked
extracted  tmp/unpacked/my/
files      5
Zip · log
zip logs/app.log -gz
created  logs/app.log.gz
Decompress GZIP into the current directory or <dst>
zip logs/app.log.gz tmp/app.log
extracted  tmp/app.log
Zip · data
zip data tmp/data.zip -9
created  tmp/data.zip
level    9
Zip · data
zip data tmp/data.zip -f
created  tmp/data.zip
replace  explicit
Zip · txt
zip tmp/draft.txt tmp/draft.zip -d
created  tmp/draft.zip
source   removed after successful archive creation
Extract a ZIP archive into the current directory or <dst>
zip missing.zip
File not found: missing.zip

File used in this example: sandbox/data/sample.txt

The example uses a file or directory from the protected /sandbox/ documentation workspace.

lil-terminal sandbox text file

This file is safe to read, copy, rename, replace, hash and archive.

Related documentation

Current public release

v1.2.32026-08-14

Compact ZIP options

Primary archive actions stay visible while operational flags are grouped below them.