Challenge - 5 Problems
Silent Operator
Get all challenges correct to earn this badge!
Test your skills under time pressure!
💻 Command Output
intermediate1:00remaining
What is the output of this command?
Consider the command:
What will be printed on the terminal after running it?
echo "Hello World" > /dev/nullWhat will be printed on the terminal after running it?
Linux CLI
echo "Hello World" > /dev/nullAttempts:
2 left
💡 Hint
Think about what happens when output is redirected to /dev/null.
✗ Incorrect
Redirecting output to /dev/null sends it to a special place that discards everything. So nothing appears on the terminal.
💻 Command Output
intermediate1:00remaining
What happens when you redirect error output to /dev/null?
Given the command:
What will be the output on the terminal?
ls nonexistentfile 2> /dev/nullWhat will be the output on the terminal?
Linux CLI
ls nonexistentfile 2> /dev/nullAttempts:
2 left
💡 Hint
Remember that
2> redirects error messages.✗ Incorrect
The error message from ls is sent to /dev/null, which discards it, so nothing appears on the terminal.
📝 Syntax
advanced1:30remaining
Which command correctly discards both standard output and error?
Choose the command that sends both normal output and error messages to /dev/null, so nothing appears on the terminal.
Attempts:
2 left
💡 Hint
Look for the syntax that redirects both outputs together.
✗ Incorrect
The &> operator redirects both stdout and stderr together in Bash. Option A uses &> correctly.
🔧 Debug
advanced1:30remaining
Why does this command still show output?
You run:
But you still see error messages if the file does not exist. Why?
grep 'pattern' file.txt > /dev/nullBut you still see error messages if the file does not exist. Why?
Attempts:
2 left
💡 Hint
Think about which output streams are redirected.
✗ Incorrect
Redirecting with > /dev/null only sends standard output to /dev/null. Error messages (stderr) still appear on the terminal.
🚀 Application
expert2:00remaining
How to silently run a script ignoring all output and errors?
You want to run
myscript.sh so that it produces no output or error messages on the terminal. Which command achieves this?Attempts:
2 left
💡 Hint
Redirect both stdout and stderr to /dev/null.
✗ Incorrect
Option B redirects stdout to /dev/null and then redirects stderr to where stdout points, effectively discarding both.