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