utility
tar
Create gzip-compressed archive or list members. Creation can overwrite existing archives. Use trusted explicit inputs; listing is not a security guarantee.
Formal Syntax & Structure
bash syntaxbash
tar -czf ARCHIVE FILE ...; tar -tf ARCHIVEParameters & Attributes
| Name | Type | Description |
|---|---|---|
| ARCHIVE | path | Archive path. |
| FILE | path | Explicit input member when creating. |
Return Value
exit status
Exit status 0 on success; nonzero indicates failure or a command-specific condition. See description and example.
Working Example
Example Snippetbash
mkdir reportsprintf 'ready\n' > reports/status.txttar -czf bundle.tar.gz reports/status.txttar -tf bundle.tar.gz