OS function: managing files

Tip: Choose Save as PDF in the print dialog to download. Use A4 paper size.

OS function: managing files

Name:
Date:
Class:

Quick Questions

Shade in the A or B circle for each question.

1. Which statement describes the OS function of managing files?
A The OS keeps track of files and folders and records where each file is stored
B The OS only stores files inside the CPU registers
2. A student wants to put a homework file into a different folder without making a second copy. Which action is this?
A Copying the file
B Moving the file
3. A student makes a duplicate of a project file as a safety backup, leaving the original in place. Which action is this?
A Copying the file
B Deleting the file
4. Which is a valid example of folder structure managed by the OS?
A A folder called Homework containing a subfolder called Maths
B A folder that can only ever hold one file and no subfolders
5. Two files are saved in the same folder. Which is allowed by the OS?
A Two different files that are both named Report.docx
B Report.docx and Report_v2.docx

Match the Pairs

Draw a line connecting each item on the left to its match on the right.

Left columnRight column
1copy report.docx D:\Backup\ AThe OS makes a duplicate of the file in a new folder while the original stays where it is
2del C:\Homework\old_notes.txt BThe OS removes the file from its folder so the user can no longer open it from that location
3A folder structure organises files in a hierarchy, with folders placed inside other folders Creport.docx: user = read and write, guest = read only
4File permissions control who can read or write a file, and the OS enforces them DC:\School\Science\Biology\cells.docx
5move photo.jpg D:\Pictures\ (the original photo.jpg is still in the old folder) EMoving a file takes it out of the old folder, so the original should not remain. Leaving it behind describes copying, not moving.
6Two files in the same folder are both named essay.docx FTwo files in the same folder cannot share a name because the OS would not know which file is being asked for.

Definitions

file management

Fill in the Blanks

Complete each line of code by filling in the missing parts.

1.
_____ homework
2.
__ report.txt backup/
3.
__ report.txt archive/
4.
__ old_notes.txt
5.
chmod __ report.txt

Spot the Error

Shade in the letter of the line that contains an error.

Question 1
A rm Homework
B cd Homework
C touch essay.txt
D ls
Question 2
A # Copy report to backup
B cd Documents
C mv report.txt backup/
Question 3
A # Move photo to Pictures
B cp photo.jpg Pictures/
C ls Pictures
Question 4
A # Delete the old draft
B cd Documents
C ls
D rm draft old.txt
Question 5
A # Make notes.txt read only
B chmod +w notes.txt
C ls -l notes.txt

Answer Key

OS function: managing files
Section A: Quick Questions
Q1
A — The OS keeps track of files and folders and records where each file is stored
Q2
B — Moving the file
Q3
A — Copying the file
Q4
A — A folder called Homework containing a subfolder called Maths
Q5
B — Report.docx and Report_v2.docx
Section B: Match the Pairs
Q1
copy report.docx D:\Backup\ → The OS makes a duplicate of the file in a new folder while the original stays where it is
Q2
del C:\Homework\old_notes.txt → The OS removes the file from its folder so the user can no longer open it from that location
Q3
A folder structure organises files in a hierarchy, with folders placed inside other folders → C:\School\Science\Biology\cells.docx
Q4
File permissions control who can read or write a file, and the OS enforces them → report.docx: user = read and write, guest = read only
Q5
move photo.jpg D:\Pictures\ (the original photo.jpg is still in the old folder) → Moving a file takes it out of the old folder, so the original should not remain. Leaving it behind describes copying, not moving.
Q6
Two files in the same folder are both named essay.docx → Two files in the same folder cannot share a name because the OS would not know which file is being asked for.
Section C: Definitions
Q1
file management — An OS function that keeps track of files and folders, lets users create, name, open, copy, move and delete them, and records where each file is stored.
Section D: Fill in the Blanks
Q1
mkdir homework
Q2
cp report.txt backup/
Q3
mv report.txt archive/
Q4
rm old_notes.txt
Q5
chmod -w report.txt
Section E: Spot the Error
Q1
A — rm deletes files and folders. To create a new folder the OS needs mkdir Homework, otherwise the later cd Homework fails.
Q2
C — mv moves the file, so the original disappears from Documents. To make a copy and keep the original, use cp report.txt backup/.
Q3
B — cp copies the file and leaves the original where it was. Moving a file needs mv photo.jpg Pictures/.
Q4
D — The space makes the OS read two file names, draft and old.txt. The file name must be written as one name: draft_old.txt.
Q5
B — +w adds write permission, so users could still change the file. To make it read only, remove write permission with chmod -w notes.txt.