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 ARCHIVE

Parameters & Attributes

NameTypeDescription
ARCHIVEpathArchive path.
FILEpathExplicit 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
Bash Reference