0
0
Linux CLIscripting~20 mins

Why network tools diagnose connectivity in Linux CLI - Challenge Your Understanding

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Network Diagnostics Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
💻 Command Output
intermediate
2:00remaining
What is the output of the ping command?
You run the command ping -c 3 8.8.8.8 on a Linux terminal. What output do you expect to see?
Linux CLI
ping -c 3 8.8.8.8
A3 packets transmitted, 0 received, 100% packet loss, time 2002ms
Bping: unknown host 8.8.8.8
C
3 packets transmitted, 3 received, 0% packet loss, time 2002ms
rtt min/avg/max/mdev = 14.123/15.456/16.789/0.567 ms
Dcommand not found: ping
Attempts:
2 left
💡 Hint
Think about what a successful ping to a public DNS server looks like.
💻 Command Output
intermediate
2:00remaining
What does traceroute show about network paths?
You run traceroute example.com. What does the output primarily show?
Linux CLI
traceroute example.com
AA list of routers (hops) between your computer and example.com with their response times
BThe IP address of example.com only
CThe DNS records of example.com
DThe current bandwidth usage of your network
Attempts:
2 left
💡 Hint
Traceroute helps you see the path your data takes.
📝 Syntax
advanced
2:00remaining
Which command correctly checks open ports on a host?
You want to check if port 80 is open on 192.168.1.1 using netcat (nc). Which command is correct?
Anc -x 192.168.1.1 80
Bnc -zv 192.168.1.1 80
Cnc -p 80 192.168.1.1
Dnc -l 192.168.1.1 80
Attempts:
2 left
💡 Hint
Use netcat to scan ports without sending data.
🔧 Debug
advanced
2:00remaining
Why does this ping command fail?
You run ping -c 4 google.com but get the error: ping: unknown host google.com. What is the likely cause?
Linux CLI
ping -c 4 google.com
AThe DNS server is unreachable or not configured properly
BThe ping command is missing the -c option
CThe internet connection is too slow
DThe IP address of google.com has changed
Attempts:
2 left
💡 Hint
The error means the hostname cannot be resolved.
🚀 Application
expert
3:00remaining
What is the output of this complex network diagnostic script?
Consider this bash script that checks connectivity and logs results:
#!/bin/bash
host=8.8.8.8
if ping -c 2 $host > /dev/null 2>&1; then
  echo "Host $host is reachable"
else
  echo "Host $host is unreachable"
fi
What will be the output if the host is reachable?
Linux CLI
#!/bin/bash
host=8.8.8.8
if ping -c 2 $host > /dev/null 2>&1; then
  echo "Host $host is reachable"
else
  echo "Host $host is unreachable"
fi
ASyntax error near unexpected token `then'
BHost 8.8.8.8 is unreachable
Cping: unknown host 8.8.8.8
DHost 8.8.8.8 is reachable
Attempts:
2 left
💡 Hint
The script uses ping and checks its success silently.