Archive, compress and restore files with a single, reliable command. 16.11.2025 | reading time: 3 min You need a fast, local backup: tar does exactly that by bundling files into one archive and optionally compressing them; this lesson shows how to create, list and restore simple backups so he can get results now. A practical example you can run Create a gzip compressed archive of the folder "/home/projects" and then inspect and extract it with these commands: ``` tar -czvf /tmp/projects-2025-11-16.tar.gz -C /home projects # sample output (files listed while creating): projects/ projects/file1.txt projects/src/main.c # list archive contents: tar -tzvf /tmp/projects-2025-11-16.tar.gz -rw-r--r-- 1000/1000 1234 2025-11-16 12:00 projects/file1.txt # extract to /mnt/restore: tar -xzvf /tmp/projects-2025-11-16.tar.gz -C /mnt/restore ``` Options and common pitfalls Choose compression with -z (gzip), -j (bzip2) or -J (xz) depending on speed versus size; avoid using -r with compressed archives because appending requires an uncompressed tar file; prefer `-C` to avoid storing absolute paths and use `--exclude` to skip transient files; verify archives by listing with `-t` or compare with `--diff` and keep a checksum like sha256sum for integrity checks; for incremental snapshots explore `--listed-incremental` but test it carefully before relying on it. When to use tar and what else to consider Tar is ideal for simple full backups, packaging logs or creating archive snapshots for transfer, but it lacks deduplication and built-in encryption; for scheduled or remote incremental backups combine tar with cron and rsync or wrap archives in GPG for encryption; always test restores on a separate directory to confirm permissions and ownership behavior. Try other backup approaches For larger datasets or more advanced features consider tools that add network transfer, deduplication and encryption; start with a simple tar-based workflow, then evaluate more specialized solutions if speed, security or storage efficiency becomes critical. Looking forward Mastering tar gives immediate, practical backup capability and a clear foundation to explore rsync, deduplicating repositories and snapshot tools; keep experimenting and consider formalizing skills with certifications like CompTIA Linux+ or LPIC-1 and intensive exam preparation at bitsandbytes.academy to accelerate progress. Join Bits & Bytes Academy First class LINUX exam preparation. backup utilities filesystem storage scripting