← All sims

Systems Administration Lab: Archiving & Extracting a Home Directory

Scenario: Joe has taken over a position previously held by Ann. As the systems administrator, you need to archive all the files from Ann's home directory, then extract that archive into Joe's home directory. Build the correct tar command in each tab below by clicking the command objects in the right order. Each object (except the spacebar) can only be used once. Not every object is needed.
tar
tar -cvf /tmp/ann.tar -C /home ann
tarInvokes the tar (tape archive) utility, used to bundle multiple files/directories into a single archive file.
-c"Create" — tells tar to create a new archive rather than extract or list one.
-v"Verbose" — prints the name of each file as it is added, so you can see progress on screen.
-f"File" — specifies that the very next argument is the filename of the archive to create (here, /tmp/ann.tar). This flag must come immediately before the filename.
/tmp/ann.tarThe path and name of the archive file that will be created. ".tar" is the conventional extension for an uncompressed tar archive.
-C /home"Change directory" — tells tar to change into /home before archiving, so the paths stored inside the archive are relative (e.g. "ann/...") instead of absolute.
annThe target: Ann's home directory (relative to /home), whose entire contents will be added to the archive.
tar
tar -xvf /tmp/ann.tar -C /home/joe
tarInvokes the tar utility again, this time to unpack an existing archive.
-x"Extract" — tells tar to pull files out of an existing archive instead of creating one.
-v"Verbose" — lists each file as it is extracted.
-f"File" — indicates the next argument is the archive file to read from (/tmp/ann.tar), the same file created in the Archive step.
/tmp/ann.tarThe archive created earlier, containing all of Ann's files.
-C /home/joe"Change directory" — tells tar to extract into Joe's home directory instead of the current working directory, placing Ann's old files where Joe can use them.