Challenge - 5 Problems
File System Navigator
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate1:30remaining
Why is file system navigation essential before scripting?
Imagine you want to automate a task that involves files on your computer. Why must you first learn how to move around the file system using commands like
cd and ls?Attempts:
2 left
💡 Hint
Think about how a script finds the files it needs to work with.
✗ Incorrect
Scripts often work with files. To tell a script where to find or save files, you must understand how to move through folders and know file locations. This is why navigation is the first skill.
💻 Command Output
intermediate1:00remaining
What is the output of this navigation command?
You run these commands in order:
What will be the output?
cd /usrcd localpwdWhat will be the output?
Linux CLI
cd /usr cd local pwd
Attempts:
2 left
💡 Hint
Each
cd moves you into a folder inside the current one.✗ Incorrect
First,
cd /usr moves to the /usr folder. Then cd local moves inside the local folder within /usr. So pwd shows /usr/local.📝 Syntax
advanced0:45remaining
Which command correctly lists all files including hidden ones?
You want to see all files in the current folder, even those starting with a dot (hidden files). Which command is correct?
Attempts:
2 left
💡 Hint
The option to show hidden files is a single letter.
✗ Incorrect
The
-a option with ls shows all files including hidden ones. Other options do not show hidden files.🔧 Debug
advanced1:30remaining
Why does this navigation command fail?
You run:
Then:
But get an error:
Why?
cd /home/user/DocumentsThen:
cd ProjectsBut get an error:
bash: cd: Projects: No such file or directoryWhy?
Attempts:
2 left
💡 Hint
Check if the folder you want to enter is really inside the current folder.
✗ Incorrect
The error means the folder 'Projects' is not found inside /home/user/Documents. You must verify the folder exists or use the correct path.
🚀 Application
expert2:00remaining
How many files will this script list?
Consider this script snippet:
What does the final command output?
cd /var/logfiles=$(ls -a | grep -v '^\.')echo "$files" | wc -lWhat does the final command output?
Linux CLI
cd /var/log files=$(ls -a | grep -v '^\.') echo "$files" | wc -l
Attempts:
2 left
💡 Hint
The grep command removes lines starting with a dot.
✗ Incorrect
The script lists all files including hidden ones with
ls -a, then removes hidden files (starting with '.') using grep. The final count is of visible files and folders.