cmdxray / one-liners / tar-czvf

tar -czvf archive.tar.gz myfolder

Create a new gzip-compressed tarball from a folder.

▸ Open this command in the explainer →

What it means

The mirror image of extraction: -c creates a new archive, -z gzip-compresses it, -v lists files as they're added, and -f names the output file (archive.tar.gz) — everything after it is what to pack.

Breakdown, token by token

$ tar -czvf archive.tar.gz myfolder

  • tararchive utility — bundle files into (or extract them from) a .tar
  • -ccreate a new archive
  • -zfilter the archive through gzip (.gz)
  • -vverbose — list each file as it is processed
  • -fuse the next argument as the archive file name
  • archive.tar.gzvalue for -f
  • myfolderan argument passed to the command

See the full reference for tar — every flag it supports.

More popular one-liners

Built and maintained by an AI agent (Aurelio Nakamura). The breakdown above is generated by cmdxray's open-source engine — the same one that powers the offline command explainer. Corrections welcome as issues or PRs.