Prepare the Exhibition Print Set

LinuxBeginner
Practice Now

Introduction

FRAME is preparing a community photography exhibition. The print desk needs selected pictures under agreed exhibition names. Two intake folders contain IMG_0001.jpg, but they show different scenes. Copying everything or flattening those names would deliver the wrong collection.

You will retain the originals, create an explicit source-to-target collection, handle an existing destination safely, then open the archive from a separate recipient directory. Only basic terminal familiarity is required. The commands and path syntax are explained before use; no scripting or photography knowledge is needed.

Use Workstation for commands and Photo Desk for pictures. All photographs are small CC0 study images with credits in the reader. Intake names are fictional, not authorship claims. This is a file handover exercise; resolution, color profiles and professional print preparation are outside its scope.

Keep Two Same-Name Photographs

In this step, you will identify the selected photographs and copy two different same-name files into distinct exhibition locations.

Begin in Photo Desk. Open Sample: the sunflower is a separate example of a real picture. Open Sources and click each IMG_0001.jpg to see the full image; use the browser's Back action to return. Ada's folder shows a bridge; Ben's shows a round boat. A camera filename alone does not identify a picture.

The curator approved exactly these relationships. Paths in the left column are relative to source/; paths on the right are relative to work/print-set/:

Selected source Exhibition destination Visual identity
ada/IMG_0001.jpg Water/01-ada.jpg Bridge
ben/IMG_0001.jpg Water/02-ben.jpg Round boat
ada/Quiet Water.jpg Details/03-water.jpg Waterfall

The unselected test shot, private notes and supplied sample must stay out of the delivery. You may read sources, but keep all supplied bytes unchanged. Make regular copies, not links to another directory.

Switch to Workstation. pwd prints the current directory; cd changes it. The initial directory should be /home/labex/project/print-studio. Use the explicit path to recover if needed:

cd /home/labex/project/print-studio
pwd
/home/labex/project/print-studio

ls lists a directory. The slash in source/ada separates levels. These are relative paths, interpreted from the current directory:

ls source/ada
ls source/ben

Both contain IMG_0001.jpg; these entries are in different directories. mkdir -p creates missing parent directories and tolerates directories that already exist. Build the two destination zones:

mkdir -p work/print-set/Water work/print-set/Details

cp copies the source to the destination without moving the original. -i asks before replacing an existing destination; -v displays what it copies. -- ends command options. Quote paths so a filename with spaces remains one argument. Here each destination is a complete new filename, not just a directory:

cp -iv -- "source/ada/IMG_0001.jpg" "work/print-set/Water/01-ada.jpg"
cp -iv -- "source/ben/IMG_0001.jpg" "work/print-set/Water/02-ben.jpg"

For new destinations, the output connects each source to its destination. If asked to overwrite during a retry, type n and press Enter, then compare the existing bytes. Do not answer yes just because a filename looks familiar.

cmp compares file bytes. No output means the files match; a difference produces a message and a nonzero exit status. Verify both relationships:

cmp -- "source/ada/IMG_0001.jpg" "work/print-set/Water/01-ada.jpg"
cmp -- "source/ben/IMG_0001.jpg" "work/print-set/Water/02-ben.jpg"

Return to Photo Desk, open Staging, and reload if needed. Open both pictures. The two destination names should show the bridge and boat separately. A successful copy message is not a substitute for checking the actual pictures and their mapping.

Resolve a Destination Conflict Safely

In this step, you will refuse an incorrect overwrite, understand its evidence, and complete the curated collection. Begin in the same Workstation terminal.

A destination name is a promise to the print desk. To see why the prompt matters, deliberately propose copying Ben's boat over Ada's bridge. The following command is an intentional conflict exercise. At its overwrite question, type n and press Enter:

cp -iv -- "source/ben/IMG_0001.jpg" "work/print-set/Water/01-ada.jpg"

The bridge should remain intact. Compare the proposed boat with that protected destination:

cmp -- "source/ben/IMG_0001.jpg" "work/print-set/Water/01-ada.jpg"

Expect a differ message. This nonzero exit is intentional: the proposed source does not belong at this destination. Now confirm that the destination still matches the approved source:

cmp -- "source/ada/IMG_0001.jpg" "work/print-set/Water/01-ada.jpg"

No output confirms that refusing the overwrite preserved the bridge. The conflict rule is: reject an existing destination first, compare it with the intended source, and keep it only if it matches. If it differs, consult the approved mapping before replacing anything. Never infer permission from a repeated camera filename.

Complete the third relationship. The quotes around Quiet Water.jpg protect its space:

cp -iv -- "source/ada/Quiet Water.jpg" "work/print-set/Details/03-water.jpg"
cmp -- "source/ada/Quiet Water.jpg" "work/print-set/Details/03-water.jpg"

Test a normal repeat of the first copy. Type n at the question, then compare:

cp -iv -- "source/ada/IMG_0001.jpg" "work/print-set/Water/01-ada.jpg"
cmp -- "source/ada/IMG_0001.jpg" "work/print-set/Water/01-ada.jpg"

You have kept an identical existing copy without producing nested directories or overwriting a different picture. In Photo Desk → Staging, open all three pictures and compare their displayed paths to the table. The waterfall belongs in Details; the bridge and boat belong in Water. The sunflower and private notes are absent.

If you accidentally answered yes in the conflict exercise, the source bridge still exists. After consulting the table, run the approved Ada-to-01 copy from step 1, answer y to replace only that known wrong destination, and run its cmp again. Do not delete the source tree or clear the whole workspace to recover.

Hand Over a Collection That Opens Independently

In this step, you will archive only the curated tree, unpack it into a separate receiving directory, and open the actual received photographs.

Begin in Workstation. tar stores a collection in one archive. In -czf, c creates it, z compresses it with gzip, and f names the following archive file. -C work changes tar's starting directory before selecting print-set. Thus the archive contains one print-set/ root, without work/, source/, or absolute home-directory paths. Running this command again replaces the archive from the current staging tree:

tar -czf delivery.tar.gz -C work print-set

For listing, t replaces c. It reads the archive without extracting:

tar -tzf delivery.tar.gz

Expect print-set/, the Water and Details directories, and exactly the three selected photo files. Directory order is unimportant. A listing that includes source, a test shot or notes means the wrong directory was archived; recreate the archive from the curated tree.

mkdir recipient creates a new empty receiving directory. Without -p, it refuses an existing directory, helping you avoid mistaking old received files for a fresh handover:

mkdir recipient

For extraction, x replaces c; -C recipient puts the archive in that directory:

tar -xzf delivery.tar.gz -C recipient

The receiver now has its own recipient/print-set, independent of the source paths. Compare every received relationship:

cmp -- "source/ada/IMG_0001.jpg" "recipient/print-set/Water/01-ada.jpg"
cmp -- "source/ben/IMG_0001.jpg" "recipient/print-set/Water/02-ben.jpg"
cmp -- "source/ada/Quiet Water.jpg" "recipient/print-set/Details/03-water.jpg"

All three comparisons should be silent. In Photo Desk → Recipient, reload, open each photograph, and return with Back. Confirm the bridge, boat and waterfall under their agreed names. This page reads received copies only. Use Download delivery archive to obtain the actual archive, not a generated substitute. Check Sources and Sample still open normally.

For a fresh receiving test on a retry, preserve the previous result with mv, which moves or renames rather than copies. Use the following only when recipient already exists and recipient-previous does not; choose a new unused backup name on later retries:

mv -- recipient recipient-previous

Then repeat mkdir recipient and the extraction command. Never extract into the source tree. If a staging relationship was wrong, correct only the affected destination using the conflict rule, rebuild the archive, and use a fresh receiving directory. The originals make recovery possible.

Summary

You identified pictures by source path and visual content, mapped selected originals to exhibition names, refused an incorrect overwrite and checked bytes with cmp. You delivered only the curated tree and opened its independent receiving copy. The same method applies when an agreed handover layout differs from the original directory structure.