Challenge - 5 Problems
Pwd Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
💻 Command Output
intermediate1:00remaining
What is the output of the pwd command?
You run the
pwd command in your terminal. What does it show?Linux CLI
pwd
Attempts:
2 left
💡 Hint
Think about what 'pwd' stands for and what it shows you in your terminal.
✗ Incorrect
The pwd command prints the full path of the current directory you are in. It does not show the prompt, list files, or error unless the directory doesn't exist.
💻 Command Output
intermediate1:30remaining
What happens if you run pwd after changing directories?
You run these commands in order:
What is the output of the second command?
cd /var/logpwdWhat is the output of the second command?
Linux CLI
cd /var/log pwd
Attempts:
2 left
💡 Hint
The
cd command changes your directory, and pwd shows where you are now.✗ Incorrect
After changing directory to /var/log, running pwd shows the new current directory path.
📝 Syntax
advanced1:00remaining
Which command correctly prints the current directory?
Choose the correct command that prints the current working directory.
Attempts:
2 left
💡 Hint
The command is a simple shell command without parentheses or extra words.
✗ Incorrect
The pwd command is a standard shell command. Adding parentheses or extra words causes errors or is invalid.
🔧 Debug
advanced1:30remaining
What error occurs if you run pwd in a deleted directory?
You are inside a directory, then from another terminal, that directory is deleted. Now you run
pwd. What happens?Linux CLI
pwd
Attempts:
2 left
💡 Hint
Think about what happens if your current directory no longer exists.
✗ Incorrect
If the directory you are in is deleted, pwd cannot find it and shows an error message.
🚀 Application
expert2:00remaining
How to use pwd output in a script to create a backup folder?
You want to create a backup folder named 'backup' inside your current directory using a shell script. Which command correctly uses
pwd output to do this?Attempts:
2 left
💡 Hint
Use command substitution syntax to get the output of pwd.
✗ Incorrect
To use the output of pwd inside a command, you must use $(pwd) or backticks. The other options misuse the syntax.