Skip to content

Quiz: File Management, Packages, and Remote Access on the Pi 500+

Test your understanding of file management, packages, and remote access on the Pi 500+ with these review questions.


1. What does the mv command do?

  1. Creates a new, empty directory at a given location
  2. Duplicates a file, leaving the original in place
  3. Relocates a file to a new location, or renames it, without leaving a copy behind
  4. Permanently deletes a file
Show Answer

The correct answer is C. The move file command, mv, relocates a file to a new location — or, used within the same directory, renames it — without leaving a copy behind. Option A describes mkdir, option B describes cp, and option D describes rm.

Concept Tested: Move File Command


2. What is a cron job?

  1. A named value stored by the shell that programs can read to change their behavior
  2. A text file containing a sequence of shell commands run all at once
  3. A program that automates finding, installing, and updating software
  4. A schedule that runs a shell script or command automatically at specified, recurring times
Show Answer

The correct answer is D. A cron job schedules a shell script (or any command) to run automatically at specified, recurring times, entirely on its own, without anyone remembering to type anything. Option A describes an environment variable, option B describes a shell script itself, and option C describes a package manager.

Concept Tested: Cron Job


3. How does SSH remote login differ from VNC remote desktop, according to the chapter's comparison?

  1. SSH streams the full graphical desktop, while VNC provides only a terminal connection
  2. SSH provides an encrypted, text-based connection for typing commands, while VNC streams the entire graphical desktop over the network
  3. SSH and VNC both require exactly the same amount of network bandwidth
  4. SSH can only be used on a local network, while VNC works over the internet
Show Answer

The correct answer is B. SSH provides an encrypted, text-based connection letting you type commands on a remote Pi 500+ as if sitting in front of it, while VNC goes further and streams the entire graphical desktop, requiring more bandwidth. Option A reverses these roles. Option C ignores the chapter's explicit bandwidth comparison, and option D invents a network restriction the chapter does not describe.

Concept Tested: SSH Protocol


4. What is the difference between sudo apt update and sudo apt upgrade?

  1. apt update refreshes the local list of available package versions without installing anything, while apt upgrade installs newer versions of already-installed packages using that refreshed list
  2. apt update installs newer versions of existing packages, while apt upgrade only refreshes the package list
  3. apt update and apt upgrade are two names for the exact same operation
  4. apt update installs brand-new packages, while apt upgrade removes packages
Show Answer

The correct answer is A. The chapter explicitly states that apt update refreshes APT's local list of available software versions without installing anything by itself, while apt upgrade then installs newer versions of already-installed packages using that refreshed list. Option B reverses these roles. Option C incorrectly treats them as identical, and option D confuses upgrade with the separate install and remove operations.

Concept Tested: Update System Command


5. What is the purpose of an environment variable like $HOME or $PATH?

  1. It permanently deletes files matching a given pattern
  2. It schedules a shell script to run at a recurring time
  3. It is a named value stored by the shell or operating system that programs can read to change their behavior, such as knowing where to search for commands
  4. It lists every process currently running on the system
Show Answer

The correct answer is C. An environment variable is a named value stored by the shell or operating system that programs can read to change their behavior — $HOME holds the path to your home directory, and $PATH lists the directories the shell searches when you type a command name. Option A describes rm, option B describes a cron job, and option D describes a task manager.

Concept Tested: Environment Variable


6. A cron entry reads: 0 9 * * * /home/pi/battery_check.sh. Based on the chapter's explanation of cron syntax, when does this script run?

  1. Once daily, at 9:00 AM
  2. Every 9 minutes, all day
  3. Every 15 minutes between 9 AM and 10 AM
  4. Once per hour, on the hour, every day
Show Answer

The correct answer is A. Cron's five fields are minute, hour, day of month, month, and day of week; here the minute field is 0 and the hour field is 9, with every remaining field set to * (every value), meaning the script runs once at minute 0 of hour 9 — 9:00 AM — every day of every month. Options B, C, and D all misinterpret which field controls which unit of time.

Concept Tested: Cron Job


7. A student runs the following commands in order: mkdir logs, cp status.txt logs/status.txt, mv status.txt logs/status-original.txt, rm logs/status.txt. After all four commands, which files exist inside the logs directory?

  1. status.txt only
  2. status.txt and status-original.txt
  3. The logs directory is now empty
  4. status-original.txt only
Show Answer

The correct answer is D. After mkdir, logs/ exists; cp copies the original status.txt into logs/status.txt while leaving the original in place; mv then moves that remaining original status.txt into logs/status-original.txt; finally, rm deletes logs/status.txt, leaving only logs/status-original.txt behind. Option A ignores the final rm step, option B ignores that rm removed one of the two files, and option C incorrectly assumes both files were removed.

Concept Tested: Remove File Command


8. A student wants to check on a robot's headless Pi 500+ (no monitor attached) by running a couple of quick commands and reading a log file, using as little network bandwidth as possible. Which remote access option best fits this need?

  1. VNC remote desktop, since it shows the full graphical interface
  2. SSH remote login, since it provides a low-bandwidth, text-based connection for running commands
  3. The system configuration tool, accessed locally at the robot
  4. Local network discovery alone, without connecting to the Pi at all
Show Answer

The correct answer is B. The chapter's comparison table lists SSH's typical use in this book as "automating or checking on a headless robot's Pi," with low bandwidth needed since it only transmits text — exactly matching this scenario. VNC (option A) needs more bandwidth for no benefit here since no graphical program is needed. The system configuration tool (option C) requires local access, and local network discovery alone (option D) only finds the device, it doesn't let you run commands.

Concept Tested: SSH Protocol


9. A student intends to run rm -r logs_old but accidentally types rm -r logs, deleting a directory still in active use. Based on the chapter's guidance, what practice would have most directly prevented this specific mistake?

  1. Running sudo apt update before the command
  2. Using mv instead of rm for all file operations
  3. Reading the exact path typed one more time before pressing Enter, especially for rm -r, since it permanently deletes with no undo
  4. Enabling VNC before running any terminal commands
Show Answer

The correct answer is C. The chapter's explicit warning about rm states that it deletes immediately and permanently, with no confirmation and no undo, and specifically instructs readers to read the exact path typed one more time before running rm, especially rm -r — directly addressing this typo scenario. Option A and D address unrelated tasks, and option B is impractical advice since mv does not delete files at all.

Concept Tested: Remove File Command


10. A classroom has ten Pi 500+ boards, all left on the default hostname raspberrypi. A teacher tries to SSH into raspberrypi.local to check on a specific robot's board but can't reliably tell which physical board she connects to. What does the chapter recommend to prevent this exact problem?

  1. Disabling local network discovery entirely and using only VNC
  2. Running sudo apt upgrade on each board before connecting
  3. Replacing SSH with a shell script on every board
  4. Giving each Pi 500+ a distinct hostname through the system configuration tool, such as robot1, robot2, and so on
Show Answer

The correct answer is D. The chapter specifically recommends giving each Pi 500+ a distinct hostname through the system configuration tool for a classroom with several boards, since leaving every board on the default raspberrypi hostname gives a teacher no reliable way to tell which board they've connected to. Option A removes the useful discovery mechanism entirely, and options B and C address unrelated maintenance tasks that don't solve the naming collision.

Concept Tested: Hostname