← IGCSE Computer Science Paper 1

OS function: providing a command-line interface (CLI)

A user interface where you type text commands to control the computer. It is precise and quick for experts, uses few resources, but is harder to learn because commands must be remembered.

Understanding OS function: providing a command-line interface (CLI) in IGCSE Computer Science Paper 1

What it does: The student must know the word copy, the file name and the folder path. Nothing on screen prompts them, so the commands have to be remembered. One typed command deletes every .tmp file at once. This shows how quick and precise a CLI is for an experienced user. A CLI is controlled by typed text commands. Clicking icons and windows is how a GUI works. A GUI uses icons and menus that guide a beginner. A CLI needs commands to be learned first. An expert who knows the commands can do exact tasks quickly with a few typed words. The command must be typed exactly right. A CLI does not display icons, so it uses little memory.

Common mistakes: A command and its argument must be separated by a space. It should be 'cd Documents'. The CLI cannot understand 'cdDocuments'. CLI commands must be typed exactly. The command to make a folder is 'mkdir', not 'mkdr', so the computer would not recognise it.

Class: _____________________  ·  Name: _____________________  ·  Date: _________

Free printable worksheet with full answer key — or add this module to a class and your students practise it interactively.

This module's key terms are also in a printable crossword (Modules 373–389) and word search (Modules 356–389).

Take this worksheet further — free with Cloodit

Each concept is reinforced from every angle — learned, then applied, then tested.

Learning
Duo
How does a user give instructions to a command-line interface (CLI)?
By typing text commandsBy clicking icons and windows with a mouse
Matches
C:\> dri
↓
The command is misspelt. A CLI only accepts exact commands, so the computer reports an error instead of listing the files.
Applying
Meanings
Term
command-line interface (CLI)
Meaning
A user interface where you type text commands to control the computer. It is precise and quick for experts, uses few resources, but is harder to learn because commands must be remembered.
Practice
cd Homework
Testing
Gaps
$ Documents
Check Answer
Spots
1cdDocuments
2dir

Cloodit turns curriculum-aligned coding content into journeys students work through one biome at a time.

The 'Void Whale' badge — Definition Drifter, one of Cloodit's 106 collectible badges
Students earn collectable badges

Over 100 of them, across seven natural biomes.

Study Buddy
Students build a real study resource

Turns their work into revision material ready for Flash Cards and Exam study.

Diamond Dash — one of Cloodit's live, competitive Sprint games
Students lock in with Sprints

Live, competitive practice for the start of the lesson or a teacher-led lesson finisher.

A Cloodit certificate of achievement, ready to personalise and print
Custom printable certificates

Honour your top performers, or encourage a student who's trying hard — ready to print in seconds.

Quick Questions

1. How does a user give instructions to a command-line interface (CLI)?
A. By clicking icons and windows with a mouse
B. By typing text commands ✓
A CLI is controlled by typed text commands. Clicking icons and windows is how a GUI works.
2. Which statement about using a CLI is correct?
A. The user must remember the commands ✓
B. The CLI shows every available command as a button
A CLI has no menus or buttons to prompt the user, so the commands must be remembered or looked up.
3. Compared with a GUI, a CLI is usually...
A. Harder for a beginner to learn ✓
B. Easier for a beginner to learn
A GUI uses icons and menus that guide a beginner. A CLI needs commands to be learned first.
4. Why do experienced users often like a CLI?
A. It gives precise and quick control ✓
B. It needs no commands to be typed
An expert who knows the commands can do exact tasks quickly with a few typed words.
5. Which interface uses fewer system resources such as RAM and processing power?
A. GUI
B. CLI ✓
A CLI shows only text, so it needs less memory and processing power than a GUI, which must draw windows, icons and graphics.

Match the Pairs

dir → A typed command that lists the files and folders in the current folder (ls on Linux and macOS)
del report.txt → A typed command that deletes the file called report.txt straight away, with no clicking
A CLI needs the user to remember exact commands and spell them correctly, so it is harder to learn than a GUI → copy notes.txt backup\notes.txt
An expert can control the computer precisely and quickly by typing one line of text with no menus → del *.tmp
C:\> dri → The command is misspelt. A CLI only accepts exact commands, so the computer reports an error instead of listing the files.
A CLI is easy for beginners because it shows icons and menus to click → This describes a GUI. A CLI uses typed text commands, has no icons or menus, and is hard for beginners to learn.

Key Term

command-line interface (CLI)
A user interface where you type text commands to control the computer. It is precise and quick for experts, uses few resources, but is harder to learn because commands must be remembered.

Fill in the Blanks

1. $ cd Documents
Hint: Type the short command that changes the current folder (directory).
2. $ mkdir homework
Hint: Type the command that makes a new folder with the given name.
3. $ cp notes.txt backup.txt
Hint: Type the two-letter command that copies a file to a new name.
4. $ rm old_notes.txt
Hint: Type the command that removes (deletes) a file. The CLI does this instantly when the command is typed.
5. $ ls notes.txt photo.jpg
Hint: Type the command that lists the files in the current folder. The line below is its output.

Spot the Error

Question 1
A cdDocuments
B dir
C copy notes.txt backup
D del old.txt
Line A — A command and its argument must be separated by a space. It should be 'cd Documents'. The CLI cannot understand 'cdDocuments'.
Question 2
A cd Projects
B mkdr reports
C dir
D cd reports
Line B — CLI commands must be typed exactly. The command to make a folder is 'mkdir', not 'mkdr', so the computer would not recognise it.
Question 3
A OUTPUT command
B IF command = "dir" THEN
C OUTPUT "Listing files"
D ENDIF
Line A — A CLI works by the user typing a command, so the program must read it with INPUT, not display it with OUTPUT.
Question 4
A WHILE command <> "exit"
B INPUT command
C OUTPUT "Running command"
D ENDIF
Line D — A WHILE loop must be closed with ENDWHILE, not ENDIF. The CLI loop keeps asking for commands until the user types exit.
Question 5
A cd homework
B cp essay.txt
C ls backup
D rm essay.txt
Line B — The cp command needs both a source and a destination. The line should be 'cp essay.txt backup' so the file is copied to backup.

Student with a class code? Join your class →