Zest.

Bash: Create and extract archives

A short, tested Bash example for create and extract archives. Copy it and adjust the names and paths for your project.

Bash
tar -czf archive.tar.gz folder/        # create
tar -xzf archive.tar.gz                # extract
tar -xzf archive.tar.gz -C /target     # extract elsewhere
zip -r archive.zip folder/
unzip archive.zip

Find it in Zest

Search for “bash create and extract archives” in Zest and this example appears above the results, with other matches to choose from. Searches stay private.

More Bash examples

All Bash examples