Quiz: IT Fundamentals Module 02: The Command Line (Module 02 of 06)
Test your understanding of the concepts covered in this module.
50 questions
- 1
Why is the command line essential for cloud computing?
- 2
What is the difference between a terminal and a shell?
- 3
Which of the following best describes a CLI (Command Line Interface)?
- 4
What does the command `pwd` stand for, and what does it do?
- 5
You open a terminal and type `pwd`. The output is `/home/student`. What does this tell you?
- 6
What does the `ls` command do?
- 7
What additional information does `ls -la` show compared to plain `ls`?
- 8
True or False: Hidden files and directories in Linux and macOS start with a dot (`.`), such as `.bashrc` or `.ssh`.
- 9
What does the command `cd documents` do?
- 10
What does `cd ..` do?
- 11
What does `cd ~` do?
- 12
You are in `/home/student/projects/webapp`. You run `cd ../..`. Where are you now?
- 13
What does the `mkdir` command do?
- 14
What does the `touch` command do when used with a filename that does not exist?
- 15
What does the command `cp report.txt backup.txt` do?
- 16
What does the command `mv old-name.txt new-name.txt` do?
- 17
What does the command `rm notes.txt` do?
- 18
True or False: When you delete a file with `rm` on the command line, it goes to the Trash or Recycle Bin and can be recovered.
- 19
What does `rm -r my-folder` do?
- 20
Which command displays the entire contents of a file in the terminal?
- 21
What is the difference between `cat`, `less`, `head`, and `tail`?
- 22
By default, how many lines does the `head` command display?
- 23
A log file is thousands of lines long. You only want to see the most recent entries at the bottom. Which command is most appropriate?
- 24
In Linux file permissions, what do the letters `r`, `w`, and `x` stand for?
- 25
A file has the permission string `-rwxr-xr--`. What can the file's owner do?
- 26
In the permission string `-rwxr-xr--`, what can users who are NOT the owner and NOT in the group do?
- 27
What does the `chmod` command do?
- 28
What does the command `chmod 755 script.sh` do?
- 29
What does the `chown` command do?
- 30
What does the command `grep "error" log.txt` do?
- 31
Which `grep` flag makes the search case-insensitive, so it matches "Error", "ERROR", and "error"?
- 32
What does the command `find . -name "*.txt"` do?
- 33
What does the pipe symbol (`|`) do on the command line?
- 34
What does the command `cat access.log | grep "404"` do?
- 35
What does the `>` (single angle bracket) operator do?
- 36
What does the `>>` (double angle bracket) operator do?
- 37
You run `echo "Hello" > greeting.txt` and then `echo "World" > greeting.txt`. What does `greeting.txt` contain?
- 38
You run `echo "Hello" > greeting.txt` and then `echo "World" >> greeting.txt`. What does `greeting.txt` contain?
- 39
What is an environment variable?
- 40
Which command displays the value of an environment variable called `HOME`?
- 41
What does the `PATH` environment variable do?
- 42
How do you set an environment variable called `MY_VAR` to the value `hello` in a Bash shell?
- 43
True or False: Environment variables set with `export` in a terminal session persist after you close and reopen the terminal.
- 44
What is a package manager?
- 45
Which of the following are common package managers? (Select THREE.)Select multiple
- 46
What does the command `apt update` do on a Debian/Ubuntu system?
- 47
Which keyboard shortcut lets you recall the previous command you typed in most terminals?
- 48
What does pressing the Tab key do while typing a command or filename in the terminal?
- 49
You need to find all lines containing the word "timeout" in every `.conf` file within the `/etc` directory and its subdirectories. Which command accomplishes this?
- 50
A colleague gives you a script called `deploy.sh`. When you try to run it with `./deploy.sh`, you get a "Permission denied" error. What is the most likely cause, and how do you fix it?