Package and compress a directory tree.
Section: Copy and Synchronize
Create a compressed tar archive
bash
bash
tar -czf backup.tar.gz /dataExplanation
Package and compress a directory tree.
Learn the surrounding workflow
Compare similar commands or jump into common fixes when this command is part of a bigger troubleshooting path.
Related commands
Same sheet · prioritizing Copy and Synchronize
List archive contents
Inspect what an archive contains before extracting.
Copy a directory tree preserving metadata
Preserve mode, ownership, timestamps, and symlinks.
Mirror a directory with rsync
Powerful local or remote copy preserving metadata and ACLs when supported.
Sync a directory over SSH
Efficiently transfer deltas to a remote server.
Create a cpio archive from find
Useful in some initramfs and recovery workflows.