30 mixed quiz questions on Linux Command Line Skills. They include TF, MCQ, Multi-select, Matching, Ordering, Fill in the Blank with Choices, and Short Answer questions, testing concept knowledge, hands-on command skills, analysis, and higher-order thinking.
Quiz: Command Line Skills
True/False Questions
1. True/False
The command line interface is slower than the GUI and provides less control over the operating system.
Answer: False
Explanation: The CLI is powerful, fast, and gives users strong control over the system.
2. True/False
A shell is an application that allows users to access operating system services by entering commands.
Answer: True
3. True/False
Bash is one of the most commonly used shells in Linux.
Answer: True
4. True/False
Local variables remain available even after the terminal window or shell is closed.
Answer: False
Explanation: Local variables exist only in the current shell session.
5. True/False
The PATH environment variable helps the shell find executable files for commands.
Answer: True
Multiple Choice Questions
6. Multiple Choice
Which of the following best describes the CLI?
A. A graphical interface that uses icons and menus
B. A text-based interface where users type commands
C. A file manager only
D. A web browser interface
Answer: B
7. Multiple Choice
In the prompt below, what does ~ usually represent?
ivanovn@atlas:~$
A. The root directory
B. The current user’s home directory
C. The system name
D. The command history file
Answer: B
8. Multiple Choice
In the command below, what is /home?
ls /home
A. Command
B. Option
C. Argument
D. Variable
Answer: C
9. Multiple Choice
In the command below, what is -l?
ls -l
A. Argument
B. Option
C. Shell name
D. Environment variable
Answer: B
10. Multiple Choice
Which command shows the list of previously typed commands?
A. which
B. type
C. history
D. alias
Answer: C
11. Multiple Choice
Which command shows the executable file that will run when a command is typed?
A. which
B. unset
C. export
D. history
Answer: A
Example:
which ls
12. Multiple Choice
Which command can identify whether a command is internal, external, alias, or function?
A. pwd
B. type
C. env
D. echo
Answer: B
Multi-Select Questions
13. Multi-Select
Which of the following are popular Bash shell features?
Select all that apply.
A. Command history
B. Inline editing
C. Scripting
D. Aliases
E. Variables
F. Automatic hardware replacement
Answers: A, B, C, D, E
14. Multi-Select
Which of the following are valid parts of a typical Linux command format?
Select all that apply.
A. Command
B. Options
C. Arguments
D. Wallpaper
E. Keyboard layout only
Answers: A, B, C
General format:
command [options]… [arguments]…
15. Multi-Select
Which commands are examples of shell built-in/internal commands mentioned in the module?
Select all that apply.
A. cd
B. echo
C. /bin/ls
D. /usr/bin/cal
Answers: A, B
16. Multi-Select
Which statements about environment variables are correct?
Select all that apply.
A. They help control the Linux runtime environment
B. They are also called global variables
C. Examples include PATH, HOME, and HISTSIZE
D. They can never be displayed
E. The env command can list them
Answers: A, B, C, E
17. Multi-Select
Which commands are related to aliases?
Select all that apply.
A. alias
B. unalias
C. type
D. history
E. format
Answers: A, B, C
Explanation:
alias displays or creates aliases.
unalias removes aliases.
type can identify whether a command is an alias.
Fill in the Blank with Choices
18. Fill in the Blank
A command is a program that performs an __________ on the computer.
Choices:
A. icon
B. action
C. extension
D. theme
Answer: B. action
19. Fill in the Blank
The most commonly used shell in Linux is __________.
Choices:
A. Bash
B. Finder
C. Explorer
D. Android
Answer: A. Bash
20. Fill in the Blank
The command __________ is used to turn a local variable into an environment variable.
Choices:
A. unset
B. export
C. which
D. history
Answer: B. export
21. Fill in the Blank
The command __________ removes a variable.
Choices:
A. unset
B. alias
C. which
D. type
Answer: A. unset
Matching Questions
22. Matching
Match each term with its correct description.
| Term | Description |
| 1. CLI | A. Program that processes commands |
| 2. Terminal | B. Text-based interface for typing commands |
| 3. Shell | C. Program that runs a shell |
| 4. Bash | D. Common Linux shell |
Answer:
| Term | Correct Description |
| CLI | B |
| Terminal | C |
| Shell | A |
| Bash | D |
23. Matching
Match each command with its purpose.
| Command | Purpose |
| 1. history | A. Shows the path of an executable command |
| 2. which | B. Shows command history |
| 3. env | C. Lists environment variables |
| 4. unset | D. Removes a variable |
| 5. export | E. Converts a local variable into an environment variable |
Answer:
| Command | Correct Purpose |
| history | B |
| which | A |
| env | C |
| unset | D |
| export | E |
24. Matching
Match each command type with its correct meaning.
| Command Type | Meaning |
| 1. Internal command | A. Short name for a longer command |
| 2. External command | B. Command built into the shell |
| 3. Alias | C. Command stored as an executable file |
| 4. Function | D. Structure used to create or change command behavior |
Answer:
| Command Type | Correct Meaning |
| Internal command | B |
| External command | C |
| Alias | A |
| Function | D |
Ordering Questions
25. Ordering
Put the steps in the correct order to create and display a local variable.
A. Display the value using echo $var
B. Assign the value using var=Hello
C. Open or use a shell
Correct Order:
- C
- B
- A
Final Commands:
var=Hello
echo $var
26. Ordering
Put the steps in the correct order to make a local variable available as an environment variable and confirm it.
A. Use env | grep var
B. Create the variable using var=Hello
C. Export the variable using export var
Correct Order:
- B
- C
- A
Final Commands:
var=Hello
export var
env | grep var
27. Ordering
Put the steps in the correct order to create, test, and remove an alias.
A. Run the alias name
B. Create the alias
C. Remove the alias using unalias
D. Check the alias using type
Correct Order:
- B
- D
- A
- C
Example:
alias mydate=’cal 7 2000′
type mydate
mydate
unalias mydate
Short Answer Questions
28. Short Answer
Explain the difference between an option and an argument. Give one example command.
Sample Answer:
An option modifies the behavior of a command. An argument gives the command additional information, such as a file or directory name.
Example:
ls -l /home
In this command, -l is the option and /home is the argument.
29. Short Answer / Hands-on
Write the command to create a local variable named course with the value Linux, then display the value.
Answer:
course=Linux
echo $course
30. Higher-Order Short Answer
A student types cal, but the shell returns:
command not found
Using your knowledge of external commands and the PATH variable, explain two possible reasons this happened and one command that can help investigate the problem.
Sample Answer:
One possible reason is that the cal program is not installed. Another possible reason is that the executable file exists, but its directory is not listed in the PATH variable. The shell searches the directories listed in PATH to find external commands.
A useful command is:
which cal
The student can also check the PATH variable using:
echo $PATH
REF: AI Tools
