Current Location: /home/alice
Target: /home/alice/documents/reports/2024
Answers:
cd /home/alice/documents/reports/2024cd documents/reports/2024Explanation: From Alice’s home directory, navigate down through the subdirectories.
Current Location: /home/alice/documents/projects/web
Target: /home/alice/documents/projects/scripts
Answers:
cd /home/alice/documents/projects/scriptscd ../scriptsExplanation: Both web and scripts are in the same parent directory (projects), so go up one level then down to scripts.
Current Location: /home/bob/workspace/python
Target: /home/alice/pictures/vacation
Answers:
cd /home/alice/pictures/vacationcd ../../../alice/pictures/vacationExplanation: Go up 3 levels (python → workspace → bob → home), then down to alice/pictures/vacation.
Current Location: /var/log/apache
Target: /home/alice
Answers:
cd /home/alicecd ../../../home/aliceExplanation: Go up 3 levels (apache → log → var → root), then down to home/alice.
Current Location: /home/alice/documents/reports/2023
Target: /home/alice/documents/reports/2024
Answers:
cd /home/alice/documents/reports/2024cd ../2024Explanation: Both 2023 and 2024 are in the same parent directory (reports).
Current Location: /usr/local/share/doc
Target: /usr/local/src/project/src
Answers:
cd /usr/local/src/project/srccd ../../src/project/srcExplanation: Go up 2 levels (doc → share → local), then down to src/project/src.
Current Location: /home/charlie/logs/application
Target: /home/charlie/temp
Answers:
cd /home/charlie/tempcd ../../tempExplanation: Go up 2 levels (application → logs → charlie), then down to temp.
Current Location: /opt/custom/config
Target: /opt/third-party/application/data
Answers:
cd /opt/third-party/application/datacd ../../third-party/application/dataExplanation: Go up 2 levels (config → custom → opt), then down to third-party/application/data.
Current Location: /home/alice/downloads/software/editors
Target: /home/alice/downloads/music/jazz
Answers:
cd /home/alice/downloads/music/jazzcd ../../music/jazzExplanation: Go up 2 levels (editors → software → downloads), then down to music/jazz.
Current Location: /etc/config/network
Target: /etc/config/apache
Answers:
cd /etc/config/apachecd ../apacheExplanation: Both network and apache are in the same parent directory (config).
Current Location: /home/bob/backup/daily
Target: /home/bob/workspace/databases/mysql
Answers:
cd /home/bob/workspace/databases/mysqlcd ../../workspace/databases/mysqlExplanation: Go up 2 levels (daily → backup → bob), then down to workspace/databases/mysql.
Current Location: /var/www/html
Target: /var/mail/alice
Answers:
cd /var/mail/alicecd ../../mail/aliceExplanation: Go up 2 levels (html → www → var), then down to mail/alice.
Current Location: /usr/share/applications
Target: /usr/local/bin
Answers:
cd /usr/local/bincd ../../local/binExplanation: Go up 2 levels (applications → share → usr), then down to local/bin.
Current Location: /home/alice/documents/projects/scripts
Target: /home/alice
Answers:
cd /home/alicecd ../../..Explanation: Go up 3 levels (scripts → projects → documents → alice).
Current Location: /tmp/session-123
Target: /home/charlie/logs/system
Answers:
cd /home/charlie/logs/systemcd ../../home/charlie/logs/systemExplanation: Go up 2 levels (session-123 → tmp → root), then down to home/charlie/logs/system.
Current Location: /home/alice/pictures/family
Target: /home/alice/documents (directory containing notes.txt)
Answers:
cd /home/alice/documentscd ../../documentsExplanation: Go up 2 levels (family → pictures → alice), then down to documents.
Current Location: /usr/local/src/project/build
Target: /usr/local/src/project/src
Answers:
cd /usr/local/src/project/srccd ../srcExplanation: Both build and src are in the same parent directory (project).
Current Location: /home/bob/workspace/java
Target: /home/bob/backup/weekly
Answers:
cd /home/bob/backup/weeklycd ../../backup/weeklyExplanation: Go up 2 levels (java → workspace → bob), then down to backup/weekly.
Current Location: /var/log/system
Target: /etc
Answers:
cd /etccd ../../../etcExplanation: Go up 3 levels (system → log → var → root), then down to etc.
Current Location: /home/alice/downloads/software/tools
Target: /home/alice/downloads/software/editors
Answers:
cd /home/alice/downloads/software/editorscd ../editorsExplanation: Both tools and editors are in the same parent directory (software).
Current Location: /opt/third-party/application/bin
Target: /opt/custom/bin
Answers:
cd /opt/custom/bincd ../../../custom/binExplanation: Go up 3 levels (bin → application → third-party → opt), then down to custom/bin.
Current Location: /home/charlie/logs/application
Target: /home/alice/documents/projects/web
Answers:
cd /home/alice/documents/projects/webcd ../../../alice/documents/projects/webExplanation: Go up 3 levels (application → logs → charlie → home), then down to alice/documents/projects/web.
Current Location: /usr/share/fonts
Target: /usr/local/share/man/man1
Answers:
cd /usr/local/share/man/man1cd ../../local/share/man/man1Explanation: Go up 2 levels (fonts → share → usr), then down to local/share/man/man1.
Current Location: /home/alice/documents/reports/2024
Target: /home/alice/documents/projects
Answers:
cd /home/alice/documents/projectscd ../../projectsExplanation: Go up 2 levels (2024 → reports → documents), then down to projects.
Current Location: /var/www/cgi-bin
Target: /tmp/cache
Answers:
cd /tmp/cachecd ../../../tmp/cacheExplanation: Go up 3 levels (cgi-bin → www → var → root), then down to tmp/cache.
Current Location: /home/bob/workspace/databases/postgres
Target: /home/bob/workspace/python
Answers:
cd /home/bob/workspace/pythoncd ../../pythonExplanation: Go up 2 levels (postgres → databases → workspace), then down to python.
Current Location: /etc/config/apache
Target: /var/log/apache
Answers:
cd /var/log/apachecd ../../../var/log/apacheExplanation: Go up 3 levels (apache → config → etc → root), then down to var/log/apache.
Current Location: /home/alice/pictures/vacation
Target: /home/bob/workspace
Answers:
cd /home/bob/workspacecd ../../../bob/workspaceExplanation: Go up 3 levels (vacation → pictures → alice → home), then down to bob/workspace.
Current Location: /usr/local/share/doc
Target: /usr/share/applications
Answers:
cd /usr/share/applicationscd ../../../share/applicationsExplanation: Go up 3 levels (doc → share → local → usr), then down to share/applications.
Current Location: /home/alice/downloads/music/rock
Target: /
Answers:
cd /cd ../../../../..Explanation: Go up 5 levels (rock → music → downloads → alice → home → root).
Current Location: /home/alice/documents/reports/2023
Target: /home/charlie/temp
Answer:
cd ../../../../charlie/tempExplanation: Go up 4 levels (2023 → reports → documents → alice → home), then down to charlie/temp.
Current Location: /usr/local/src/project/src
Target: /var/mail/bob
Answer:
cd ../../../../../var/mail/bobExplanation: Go up 5 levels (src → project → src → local → usr → root), then down to var/mail/bob.
Current Location: /opt/third-party/application/data
Target: First to /home/alice/pictures/family, then to /etc/config/network
Answers:
cd ../../../../home/alice/pictures/familycd ../../../../etc/config/networkExplanation:
Moving Between Sibling Directories:
/path/to/dir1 → /path/to/dir2
Answer: cd ../dir2
Moving Up Multiple Levels:
/a/b/c/d → /a
Answer: cd ../../..
Moving Across Different Branches:
/branch1/leaf → /branch2/leaf
Answer: cd ../../branch2/leaf
Moving to Root:
/any/path/here → /
Answer: cd (count levels up to root)
Visual Method:
Current: /home/alice/documents/reports/2023
Target: /home/bob/workspace
Step 1: Find common ancestor (/home)
/home/alice/documents/reports/2023
↑ common ancestor
Step 2: Count up from current to common ancestor
2023 → reports → documents → alice → home
That's 4 levels up: ../../../../
Step 3: Count down from common ancestor to target
home → bob → workspace
That's: bob/workspace
Result: cd ../../../../bob/workspace
/ - you’re giving the complete address.. to go “back/up”../target../ you needAfter each navigation, you can verify your location:
pwd # Print working directory
ls # List contents of current directory
ls -la # List detailed contents including hidden files
Next: → Review Questions
Previous: ← File System Navigation Quiz
Lesson Home: ↑ Lesson 2: The Shell
Course Home: ⌂ Introduction to Linux