Recall & Review
beginner
What does the
cd command do in Linux?The
cd command changes the current working directory to another directory you specify.Click to reveal answer
beginner
How do you go back to your home directory using
cd?Simply type
cd without any arguments or cd ~ to return to your home directory.Click to reveal answer
beginner
What does
cd .. do?It moves you up one directory level, to the parent directory of your current location.
Click to reveal answer
beginner
How can you move to an absolute path using
cd?Type
cd followed by the full path starting from root, for example, cd /usr/local/bin.Click to reveal answer
beginner
What happens if you try
cd to a directory that does not exist?You will get an error message like
bash: cd: directory: No such file or directory.Click to reveal answer
What command takes you to the parent directory?
✗ Incorrect
cd .. moves you up one directory level to the parent directory.How do you return to your home directory quickly?
✗ Incorrect
cd ~ or just cd takes you to your home directory.Which command changes directory to an absolute path?
✗ Incorrect
Absolute paths start with
/, so cd /usr/bin is absolute.What does
cd - do?✗ Incorrect
cd - switches back to the last directory you visited.If you type
cd unknown and the directory does not exist, what happens?✗ Incorrect
You get an error and stay where you are because the directory does not exist.
Explain how to navigate to your home directory and then move up one level using
cd commands.Think about what <code>cd</code> alone does and what <code>..</code> means.
You got /4 concepts.
Describe the difference between using a relative path and an absolute path with the
cd command.Consider paths starting with <code>/</code> versus those that don't.
You got /4 concepts.