Challenge, Easy,  on  Linux

Archive and Extract Files and Directories with tar

The tar command is one of the most essential Linux utilities for working with file archives. In this challenge, you'll practice three fundamental tar operations.

Task 1: Extract a Website Backup

A compressed archive with a website backup is located at ~/website-backup.tar.gz. The archive contains several HTML pages, stylesheets, JavaScript files, images, and configuration files.

Extract the archive so that the website files appear under ~/website/.

Hint 1

Check tar --help or man tar to find the flags for extracting a gzip-compressed archive file.

Task 2: Create a Project Archive

A project directory at ~/project/ contains source code, documentation, tests, and configuration files (including hidden ones like .gitignore).

Create a gzip-compressed tar archive of the entire project directory and save it as ~/project-backup.tar.gz. The archive must preserve project/ as the top-level directory entry.

Hint 2

To create a gzip-compressed archive, combine the -c, -z, and -f flags.

Task 3: Install containerd from the Release Tarball

Many server-side tools are distributed as pre-compiled tarballs. A containerd release archive has been downloaded to ~/containerd.tar.gz.

Install it by extracting the archive directly into /usr so that the containerd binaries (like containerd and ctr) end up on the system PATH.

Hint 3

Peek inside the archive first to understand its structure:

tar -tzf ~/containerd.tar.gz | head -20
Hint 4

Use tar -C to extract directly into the target prefix. Since the archive has bin/containerd, bin/ctr, and other containerd binaries, extracting into /usr places the binaries at /usr/bin - exactly where they need to be.