zip command mac code example Example: compress file in terminal Click to copytar -czvf name-of-archive.tar.gz /path/to/directory-or-file