Recall & Review
beginner
What is an absolute path in Linux?
An absolute path is the full address to a file or folder starting from the root directory
/. It shows the exact location regardless of your current folder.Click to reveal answer
beginner
What is a relative path in Linux?
A relative path shows the location of a file or folder based on your current directory. It does not start with
/ and depends on where you are in the folder tree.Click to reveal answer
beginner
Which symbol represents the current directory in relative paths?
The dot
. represents the current directory. For example, ./file.txt means the file is in the folder you are currently in.Click to reveal answer
beginner
How do you move up one directory level using a relative path?
Use two dots
.. to move up one level. For example, ../file.txt means the file is in the parent folder of your current directory.Click to reveal answer
intermediate
Why might you prefer relative paths over absolute paths in scripts?
Relative paths make scripts more flexible because they work based on where you run them. Absolute paths always point to the same place, which can cause errors if files move or the script runs on another system.
Click to reveal answer
Which of these is an absolute path?
✗ Incorrect
Absolute paths always start with a slash
/ indicating the root directory.What does
../ mean in a relative path?✗ Incorrect
.. means the parent directory, one level up from the current folder.If your current directory is
/home/user, what absolute path does ./docs/file.txt refer to?✗ Incorrect
The dot
. means current directory, so it adds docs/file.txt inside /home/user.Which path is more flexible for scripts that move between folders?
✗ Incorrect
Relative paths adapt to the current folder, making scripts easier to move and reuse.
What does an absolute path always start with?
✗ Incorrect
Absolute paths always start with a slash
/ which is the root directory.Explain the difference between absolute and relative paths in Linux.
Think about how you find a file on your computer starting from the main folder versus from where you are now.
You got /4 concepts.
Describe how you would use relative paths to navigate up and down directories.
Imagine walking inside a building and moving up stairs or staying in the same room.
You got /4 concepts.