1
0
mirror of https://github.com/onkelbeh/cheatsheets.git synced 2026-08-16 05:54:53 +02:00
Files
cheatsheets/tar.md
Jakob (Koby) Shimony a2d0c9279d fix typo in tar.md (#2020)
* fix typo in tar.md

* Fix indentation
2023-07-19 22:58:25 +10:00

1.3 KiB

title, category, layout, updated, intro
title category layout updated intro
tar CLI 2017/sheet 2022-08-11 Concatenate, Deflate, Inflate files

Reference

{:.-two-column}

Deflate / Inflate / Concatenate

# Deflate / Compress
tar -czf archive.tar.gz /path/files
# Inflate / Uncompress
tar -xzf archive.tar.gz
# Concatenate files into a single tar
tar -cf archive.tar /path/files
# Extract file to a defined directory
tar -xzf archive.tar.gz -C /target/directory
# Append a file to an existing archive
tar -zu archive.tar.gz -C /target/file

Common options

Option Description
z compress with gzip
c create an archive
u append files which are newer than the corresponding copy in the archive
f filename of the archive
v verbose, display what is inflated or deflated
a unlike of z, determine compression based on file extension