Archive & KomprimierungCLI Manual
$tar
Dateien in Archivdateien (.tar, .tar.gz) packen und entpacken.
BefehlssyntaxPOSIX Standard
tar [OPTIONS] [ARCHIVE-FILE] [FILE...]Live im interaktiven Terminal ausprobieren
Client-seitige Simulation ohne Installation mit sofortigem Feedback.
bash — terminal
AST Sandbox (Free)
Überblick & Funktionsweise
tar ist das Standardprogramm zum Erstellen und Entpacken von Archiven unter Linux.
Wichtige Optionen und Flags
| Flag / Option | Description |
|---|---|
| -c, --create | Create a new tar archive. |
| -x, --extract | Extract files from an existing archive. |
| -z, --gzip | Compress or decompress archive using gzip algorithm. |
| -v, --verbose | Verbosely list files processed. |
| -f, --file [ARCHIVE] | Use archive file specified. |
| -t, --list | List 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/projectsCreates a compressed archive named backup.tar.gz containing all files in projects.
#2Extract a .tar.gz archive
tar -xzvf backup.tar.gz -C /tmpExtracts all contents of backup.tar.gz into the /tmp directory.