An archive turns a folder into a single file you can move or back up, and compression makes it smaller. These questions cover tar, gzip, and the listing you should always do before extracting anything you did not create.
Each one is marked as you go, and the explanation arrives straight after, which is
the part worth reading.
4 questions, marked as you go.
Tasks
These need your own device. Run the command in Termux, then paste what it printed.
The marking looks at what the output means, so spacing, version numbers and
ordering do not matter. If you have not installed anything yet, the
lesson covers the setup.
Pack a folder and list it back
This builds a small folder, packs it into a compressed tar archive, then lists the archive contents without extracting anything.
Run this in Termux
On your own device. Nothing on this page executes it. The command runs in
your terminal, and this box only reads what you paste back.
mkdir -p ~/project/notes; echo alpha > ~/project/a.txt; echo beta > ~/project/notes/c.txt; tar -czf ~/project.tar.gz -C ~ project; tar -tzf ~/project.tar.gz
Look at the start of every line in the listing, not just the file names.
the archive stores the folder itself, so extraction rebuilds it
a file you packed is listed
every packed entry is listed, including the nested one
the commands actually ran
What a good answer looks like
A listing of the archive contents, one entry per line, with the folder and the files it holds. Every line begins with project/, which means the folder itself was stored, so extracting the archive will rebuild project/ rather than scatter the files into whatever directory you are in. The nested notes/c.txt should appear too, which shows that tar walked the whole tree.
Marking your own work
Both halves of this are checked in your browser, with no server involved, so nothing
stops you from pasting output you did not run. The tasks are written so that the
easiest way to pass one is to actually do it and read the result, which is the whole
intention.