Skip to content

Commit

Permalink
Revised quiz with stronger questions
Browse files Browse the repository at this point in the history
  • Loading branch information
cfculler committed Dec 22, 2023
1 parent 618ee9b commit 5dcc3ae
Showing 1 changed file with 23 additions and 9 deletions.
32 changes: 23 additions & 9 deletions src/quizzes/chapter-1/1.3.1/unix-quiz.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
const rawQuizdown = `
---
shuffleAnswers: true
shuffleQuestions: true
---
# If performed on a nonexistent file, all of the following commands will return a non-zero exit code except:
Expand All @@ -11,6 +12,17 @@ shuffleAnswers: true
1. [ ] cp
1. [ ] rm
# Assume you are a new user and the directory \`/home/user/docs\` does not exist. Which of the following mkdir commands will successfully create the nested directories \`/home/user/docs/work\`? Check all that apply:
- [x] mkdir -p /home/user/docs/work
> The -p or --parents flag allows mkdir to create parent directories as needed. This command will create all necessary intermediate directories, including docs.
- [x] mkdir --parents /home/user/docs/work
> The -p or --parents flag allows mkdir to create parent directories as needed. This command will create all necessary intermediate directories, including docs.
- [x] mkdir /home/user/docs && mkdir /home/user/docs/work
> This command sequence first attempts to create the docs directory and then creates the work directory inside it. Since docs does not exist, it will be created successfully, followed by the successful creation of work.
- [ ] mkdir /home/user/docs/work
> This command will fail because the intermediate directory (/home/user/docs) does not exist.
# If you run the following command on a nonexistent directory, what will happen?
\`\`\`bash
cd nonexistent-directory-name
Expand All @@ -20,16 +32,18 @@ cd nonexistent-directory-name
1. [ ] The directory will be created
1. [ ] The directory will be created AND you will navigate into it
# True or False: This command will yield the same result regardless of what your current working directory is.
\`\`\`bash
cd ~
\`\`\`
# Which of the following commands change the directory to the current user's home directory? Check all that apply:
1. [x] True
1. [ ] False
> **~** is the shorthand name for the current users home directory, and you can navigate to it from anywhere.
- [x] cd /home/$USER
> This command changes the current directory to the home directory of the user specified by the $USER environment variable.
- [x] cd ~
> This command changes the current directory to the home directory of the current user. The ~ symbol is a shortcut for the user's home directory.
- [x] cd
> Without any arguments, cd defaults to changing the directory to the current user's home directory.
- [ ] cd .
> The . symbol represents the current directory. So, this command essentially means "stay in the current directory."
# Assume that `echo-test.txt` is a new file. What will the final output be?
# Assume that \`echo-test.txt\` is a new file. What will the final output be?
\`\`\`bash
echo 'Hello' > echo-test.txt
echo 'World' > echo-test.txt
Expand All @@ -41,7 +55,7 @@ cat echo-test.txt
1. [ ] Hello<br>World
1. [ ] Hello
1. [ ] World
1. [ ] cat: nonexistent-file-name: No such file or directory
1. [ ] cat: echo-test.txt: No such file or directory
`;

export { rawQuizdown }

0 comments on commit 5dcc3ae

Please sign in to comment.