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