tar
The command that bundles a directory tree into a single archive file, lists one, or unpacks one.
In more detail
-c creates, -t lists and -x extracts; -f names the archive file and -z compresses or decompresses with gzip on the way. -C dir unpacks into another directory. List an archive before extracting it, because entries may overwrite files where you unpack.
Examples
tar -czf notes.tar.gz notestar -xzf notes.tar.gz -C restoredtar -cf dist/app.tar -C dist main.pydist/calc-2.4.0.tarRelated terms
- tarball — A tar archive compressed with gzip, usually named .tar.gz or .tgz.
- gzip — The command that compresses a single file and replaces it with a smaller .gz version; gunzip reverses it.
- artifact — A file produced by a build, such as a compiled program or an image, that is stored and passed on to later steps.
- dist directory — The conventional folder, short for distribution, where a build puts the finished files that will be shipped.
- hash — A short fixed-length fingerprint calculated from data, which changes completely if even one byte of the data changes.
Taught in
- Archives, Transfers And The Network — Bash Scripting & Command Line Automation
- What Is a Pipeline? — Continuous Integration & Continuous Delivery Pipelines
- Runners: Where Code Executes — Continuous Integration & Continuous Delivery Pipelines
- Workflows, Jobs, Steps, and Actions — Continuous Integration & Continuous Delivery Pipelines
- Verify Binaries: A Hash With No Name — Certified Kubernetes Security Specialist (CKS) Exam Prep
- Building And Versioning The Artifact — DevOps & Site Reliability Engineering
- Exam Strategy: Order, Verify, And The Docs You May Use — Red Hat Certified System Administrator (EX200) Exam Prep
- Privileged Access: sudo Rules In Drop-In Files — Red Hat Certified System Administrator (EX200) Exam Prep
- Scheduling: cron, at And systemd Timers — Red Hat Certified System Administrator (EX200) Exam Prep
- SELinux Contexts: Labels, restorecon And Rules That Last — Red Hat Certified System Administrator (EX200) Exam Prep
- requirements.yml: Installing Roles And Collections — RHCE in Ansible (EX294): Automate Red Hat Systems
- Archives: archive And unarchive On The Managed Nodes — RHCE in Ansible (EX294): Automate Red Hat Systems
- Scheduling: cron Jobs With Names, And Timers — RHCE in Ansible (EX294): Automate Red Hat Systems