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