Back to commands

Hosting Operations

Read-only

List Archive Contents Before Extracting

You need to see what an archive contains before extracting it into a restore sandbox.

Command

cd restore-dr && tar -tf backups/2026-06-25/site.tar | sed 's#^./##' | sort

Before you run this

System impact: Read-only. Low when scoped to the shown target.

When not to use it: Do not treat a file listing as byte-level integrity validation.

Expected output

Sorted archive paths such as app/config.yml, public/index.html, and uploads/avatar.txt.

System impact

Read-only. Nothing changes. The tar table of contents is read from the archive.

Recovery / rollback: no state is changed.

When to use it

Use before restore drills, migrations, or incident restores to confirm the archive shape.

When not to use it

Do not treat a file listing as byte-level integrity validation.

Watch this command run

Command transcript

This sanitized transcript shows the commands and output shape without exposing host details.

demo@lab:~$

$ cd restore-dr && tar -tf backups/2026-06-25/site.tar | sort

./
./CHECKSUMS.sha256
./app/
./app/config.yml
./app/orders.csv
./app/secrets.env
./bin/
./bin/deploy.sh
./public/
./public/index.html
./uploads/
./uploads/avatar.txt

$ cd restore-dr && tar -tf backups/2026-06-25/site.tar | sed 's#^./##' | sort | sed -n '1,12p'


CHECKSUMS.sha256
app/
app/config.yml
app/orders.csv
app/secrets.env
bin/
bin/deploy.sh
public/
public/index.html
uploads/
uploads/avatar.txt
View commands shown

These are the commands shown in the sanitized transcript.

Commands shown

  1. cd restore-dr && tar -tf backups/2026-06-25/site.tar | sort
  2. cd restore-dr && tar -tf backups/2026-06-25/site.tar | sed 's#^./##' | sort | sed -n '1,12p'

next steps

Related commands

Hosting Operations Read-only

Find Missing Files in an Old Backup

The fastest failed restore drill is the one that finds missing critical files early.

cd restore-dr && tar -tf backups/2026-06-24/site.tar | sed 's#^./##' | sort | comm -23 required-files.txt -
Hosting Operations Deletes data

Check Required Files After Restore

A successful extraction still needs a required-file check.

cd restore-dr && rm -rf restore-sandbox/full && mkdir -p restore-sandbox/full && tar -xf backups/2026-06-25/site.tar -C restore-sandbox/full && find restore-sandbox/full -type f | sed 's#^restore-sandbox/full/##' | sort | comm -23 required-files.txt -
Hosting Operations Read-only

Review Critical File Modes in the Archive

Permissions are part of the restore, not decoration.

cd restore-dr && tar -tvf backups/2026-06-25/site.tar | awk '/secrets.env|deploy.sh/ {print $1, $6}'
Hosting Operations Deletes data

Diff Restored Config Against Expected

A restored config can exist and still be the wrong config.

cd restore-dr && rm -rf restore-sandbox/full && mkdir -p restore-sandbox/full && tar -xf backups/2026-06-25/site.tar -C restore-sandbox/full && diff -u expected/app/config.yml restore-sandbox/full/app/config.yml
Hosting Operations Deletes data

Extract a Backup Into a Restore Sandbox

A restore drill should write to a sandbox, not production.

cd restore-dr && rm -rf restore-sandbox/full && mkdir -p restore-sandbox/full && tar -xf backups/2026-06-25/site.tar -C restore-sandbox/full
Study mapping

Use this as independent command practice: read the notes, predict the output, then compare it with the example before using a real shell.

  • lpic1:103-gnu-unix-commands
  • lpic1:104-filesystems-permissions-fhs
  • lfcs:essential-commands
  • lfcs:operations-deployment
  • lfcs:services-logs
  • lfcs:storage
  • linuxplus:automation-scripting
  • linuxplus:provisional
  • risk:read-only

Useful for

  • LPIC-1 style command-line practice
  • LFCS style performance tasks
  • Linux+ style troubleshooting review

Independent study support only. No affiliation, endorsement, exam dumps, or real exam questions.