Online Linux Terminal Logo
OnlineLinuxTerminal
Archive & KomprimierungCLI Manual

$tar

Dateien in Archivdateien (.tar, .tar.gz) packen und entpacken.

BefehlssyntaxPOSIX Standard
tar [OPTIONS] [ARCHIVE-FILE] [FILE...]
Linux-Community2.4k Online

Tausche dich mit Linux-Nutzern aus, lerne Befehle und lade PDF-Cheatsheets herunter.

Live im interaktiven Terminal ausprobieren

Client-seitige Simulation ohne Installation mit sofortigem Feedback.

Im Vollbild-Terminal öffnen ↗
bash — terminal

Überblick & Funktionsweise

tar ist das Standardprogramm zum Erstellen und Entpacken von Archiven unter Linux.

Wichtige Optionen und Flags

Flag / OptionDescription
-c, --createCreate a new tar archive.
-x, --extractExtract files from an existing archive.
-z, --gzipCompress or decompress archive using gzip algorithm.
-v, --verboseVerbosely list files processed.
-f, --file [ARCHIVE]Use archive file specified.
-t, --listList the contents of an archive without extracting it.

Praktische Anwendungsbeispiele

#1Compress a folder into a .tar.gz archive
tar -czvf backup.tar.gz /home/user/projects

Creates a compressed archive named backup.tar.gz containing all files in projects.

#2Extract a .tar.gz archive
tar -xzvf backup.tar.gz -C /tmp

Extracts all contents of backup.tar.gz into the /tmp directory.