# A simple, visual cheatsheet for the `tar` command in Linux.
# Learn how to create (-czvf) and extract (-xzvf) .tar.gz
# archives with practical, copy-paste ready examples.
# Create a .tar.gz archive:
xinit@localhost:~$ tar -czvf archive.tar.gz /path/to/source/dir
# Create a .tar.gz archive with long options:
xinit@localhost:~$ tar \
--create --gunzip --verbose --file \
archive.tar.gz /path/to/source/dir
# Extract a .tar.gz archive:
xinit@localhost:~$ tar -xzvf archive.tar.gz
# Extract a .tar.gz archive with long options:
xinit@localhost:~$ tar \
--extract --gunzip --verbose --file \
archive.tar.gz
# List of all available options:
xinit@localhost:~$ tar --help