tech.howto.tar

Mon Sep 14 10:27:20 AM EDT 2026 tech.howto.tar.md

tech hub

tape archive

compression

-caf

tar -caf archive.tgz stuff/

    create the archive and compress stuff/

extraction

-xf -xvf

tar -xf archive.tgz

just extract whatever its pointed at.
tar is smart enough to figure out which compression algorithm to use this side of 2009

exclude files

you can exclude files but it has to be at the start of the command [1]

tar --exclude=./site.tgz -caf site.tgz .git .gitignore .

references

1 https://stackoverflow.com/questions/984204/shell-command-to-tar-directory-excluding-certain-files-folders