Challenge - 5 Problems
Path Mastery
Get all challenges correct to earn this badge!
Test your skills under time pressure!
💻 Command Output
intermediate2:00remaining
What is the output of this command?
Assume you are currently in the directory
/home/user/docs. What will be the output of pwd after running this command?cd ../picturespwdLinux CLI
cd ../pictures pwd
Attempts:
2 left
💡 Hint
Remember that
.. means the parent directory.✗ Incorrect
The command
cd ../pictures moves up one directory from /home/user/docs to /home/user, then into pictures. So the new path is /home/user/pictures.💻 Command Output
intermediate2:00remaining
What does this absolute path command do?
What directory will you be in after running this command?
cd /var/logpwdLinux CLI
cd /var/log pwd
Attempts:
2 left
💡 Hint
Absolute paths start from the root directory
/.✗ Incorrect
The command
cd /var/log moves directly to the absolute path /var/log. So pwd outputs /var/log.📝 Syntax
advanced2:00remaining
Which command correctly changes to the parent directory using a relative path?
You want to move to the parent directory of your current location. Which command is correct?
Attempts:
2 left
💡 Hint
The parent directory is represented by
...✗ Incorrect
The command
cd .. moves you up one directory level. cd ../.. moves up two levels, cd ./.. is valid but equivalent to cd .., and cd . stays in the current directory.🔧 Debug
advanced2:00remaining
Why does this relative path command fail?
You are in
But you get an error:
What is the most likely reason?
/home/user. You run:cd documents/reportsBut you get an error:
bash: cd: documents/reports: No such file or directory.What is the most likely reason?
Linux CLI
cd documents/reports
Attempts:
2 left
💡 Hint
Check if the directory exists in your current location.
✗ Incorrect
The error means the path 'documents/reports' does not exist relative to your current directory. The most common cause is that 'documents' folder is missing or misspelled.
🚀 Application
expert3:00remaining
How many directories are in the path after this sequence?
Starting in
After these commands, how many directories deep is your current location from the root
/home/user, you run these commands:cd ../varcd logcd ../../etcAfter these commands, how many directories deep is your current location from the root
/?Linux CLI
cd ../var cd log cd ../../etc
Attempts:
2 left
💡 Hint
Track each step carefully from the root directory.
✗ Incorrect
Starting at '/home/user':
1) 'cd ../var' moves to '/home/var' (2 levels deep)
2) 'cd log' moves to '/home/var/log' (3 levels deep)
3) 'cd ../../etc' moves up two levels to '/home' then into 'etc' to '/home/etc' (2 levels deep)
So the final directory is '/home/etc' which is 2 levels deep from root.
1) 'cd ../var' moves to '/home/var' (2 levels deep)
2) 'cd log' moves to '/home/var/log' (3 levels deep)
3) 'cd ../../etc' moves up two levels to '/home' then into 'etc' to '/home/etc' (2 levels deep)
So the final directory is '/home/etc' which is 2 levels deep from root.