🧀 Learn Linux

Commonly used · Packaging and compression

tar: Pack, view and restore archives

Put in free practice

Syntax

tar -[cxt][zv]f archive [-C directory] [path…]

Options

-c
create
-x
Unpack
-t
list items
-f
archive file
-z
Teaching gzip tag
-v
Show entries
-C
Switch archive working directory

Examples

tar -czf project.tar.gz projects

Usage and sandbox support

Sandbox archives store file snapshots, not actual tar/gzip binaries.

Hands-on exercises

Full documentation ↗

Related commands