tar
Archive files and directories, often combined with compression.
Synopsis
tar [options] [archive] [files]
Core Options
-cCreate archive.
-xExtract archive.
-tList contents.
-zgzip compression (.tar.gz).
-Jxz compression (.tar.xz).
-fArchive file name.
-C dirChange directory before operation.
Usage Examples
Create gzip archive
Archive a directory.
tar -czf logs.tar.gz ./logsExtract
Extract into current directory.
tar -xzf logs.tar.gzList Contents
Inspect archive without extracting.
tar -tf logs.tar.gzExtract to a Target
Extract into /tmp.
tar -xzf logs.tar.gz -C /tmpBuilt for builders.