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