compress in tar file code example Example: tar compress tar -czvf name-of-archive.tar.gz /path/to/directory-or-file