The ping command checks if a computer or server is reachable over a network by sending small data packets and waiting for a reply.
Click to reveal answer
beginner
What is the default behavior of ping when you run it without options?
It sends continuous packets to the target until you stop it manually (usually with Ctrl+C).
Click to reveal answer
beginner
How can you limit the number of ping requests sent?
Use the -c option followed by the number of packets you want to send, for example: ping -c 4 example.com sends 4 packets.
Click to reveal answer
intermediate
What does 100% packet loss mean when using ping?
It means the target did not respond to any packets, possibly due to network issues or the target blocking ping requests.
Click to reveal answer
beginner
Why is ping useful before troubleshooting network problems?
Because it quickly shows if the target device is reachable and how long data takes to travel, helping identify where problems might be.
Click to reveal answer
What option limits the number of ping packets sent?
A-t
B-c
C-n
D-l
✗ Incorrect
The -c option specifies the count of packets to send.
What does it mean if ping shows Destination Host Unreachable?
AThe network cable is unplugged on your computer
BThe ping command is not installed
CThe target is offline or unreachable
DThe target replied successfully
✗ Incorrect
This message means your computer cannot reach the target device.
How do you stop a continuous ping command in the terminal?
APress Ctrl+C
BPress Ctrl+Z
CClose the terminal window
DType 'stop'
✗ Incorrect
Ctrl+C interrupts and stops the running ping command.
Which of these is NOT a typical use of ping?
ATransfer files between computers
BCheck if a website is reachable
CMeasure round-trip time for packets
DDetect network connectivity issues
✗ Incorrect
Ping does not transfer files; it only tests connectivity.
What does a low ping time indicate?
APacket loss
BSlow connection
CNo connection
DFast and responsive connection
✗ Incorrect
Low ping time means data travels quickly between devices.
Explain how you would use the ping command to check if a website is reachable and limit the test to 5 packets.
Think about the command syntax and option to limit packets.
You got /4 concepts.
Describe what information the ping command output gives you and why it is helpful for network troubleshooting.
Focus on what ping tells you about the connection.
You got /4 concepts.
Practice
(1/5)
1. What does the ping command do in Linux?
easy
A. Displays the current directory contents
B. Checks if your computer can reach another device on the network
C. Deletes files from the system
D. Installs new software packages
Solution
Step 1: Understand the purpose of ping
The ping command sends small packets to another device to check if it is reachable on the network.
Step 2: Compare options
Only Checks if your computer can reach another device on the network describes this network connectivity check. Other options describe unrelated commands.
Final Answer:
Checks if your computer can reach another device on the network -> Option B
Quick Check:
Ping = Network reachability check [OK]
Hint: Ping tests connection by sending packets [OK]
Common Mistakes:
Confusing ping with file or directory commands
Thinking ping installs software
Assuming ping deletes files
2. Which of the following is the correct syntax to send exactly 4 ping requests to example.com?
easy
A. ping example.com -c4
B. ping -n 4 example.com
C. ping -c 4 example.com
D. ping example.com -count 4
Solution
Step 1: Recall the option to limit ping count
The -c option followed by a number limits the number of ping requests sent.
Step 2: Check each option
ping -c 4 example.com uses -c 4 correctly. ping -n 4 example.com uses -n which is Windows syntax. ping example.com -count 4 uses incorrect syntax. ping example.com -c4 misses a space between -c and 4.
Final Answer:
ping -c 4 example.com -> Option C
Quick Check:
Use -c for count in Linux ping [OK]
Hint: Use '-c' to set ping count in Linux [OK]
Common Mistakes:
Using Windows ping options like -n
Missing space between option and number
Using incorrect option names
3. What will be the output of the command ping -c 2 127.0.0.1?
medium
A. Two ping requests sent to the local machine with reply times
B. Error: Unknown host 127.0.0.1
C. Ping command runs indefinitely
D. No output, command silently exits
Solution
Step 1: Understand the IP address 127.0.0.1
This IP is the loopback address, meaning the local machine itself.
Step 2: Analyze the command with '-c 2'
The command sends exactly 2 ping requests to the local machine and shows reply times.
Final Answer:
Two ping requests sent to the local machine with reply times -> Option A
Quick Check:
Ping 127.0.0.1 sends replies locally [OK]
Hint: 127.0.0.1 is local machine, ping replies shown [OK]
Common Mistakes:
Thinking 127.0.0.1 is unreachable
Expecting infinite ping without -c
Assuming no output is normal
4. You run ping -c 3 google.com but get the error: ping: unknown option -c. What is the likely cause?
medium
A. You are using a Windows command prompt instead of Linux terminal
B. The domain google.com does not exist
C. You forgot to add the IP address
D. The ping command is missing from your system
Solution
Step 1: Understand the error message
The error says '-c' is unknown, which is not typical in Linux but common in Windows ping.
Step 2: Identify environment mismatch
Windows ping uses '-n' for count, so running Linux-style ping with '-c' in Windows causes this error.
Final Answer:
You are using a Windows command prompt instead of Linux terminal -> Option A
Quick Check:
Windows ping uses -n, Linux uses -c [OK]
Hint: Windows ping uses -n, Linux uses -c [OK]
Common Mistakes:
Assuming domain name error
Thinking IP address is mandatory
Believing ping command is missing
5. You want to write a script that pings a server once and checks if it is reachable. Which command correctly pings 192.168.1.1 once and returns success if reachable?
hard
A. ping -c 1 192.168.1.1; echo 'Server reachable'
B. ping 192.168.1.1 -c 1 || echo 'Server reachable'
C. ping -n 1 192.168.1.1 && echo 'Server reachable'
D. ping -c 1 192.168.1.1 && echo 'Server reachable'
Solution
Step 1: Use correct ping syntax for one request
The -c 1 option sends exactly one ping request in Linux.
Step 2: Use logical AND to echo only if ping succeeds
The && operator runs the echo command only if ping returns success (reachable).
Step 3: Analyze other options
ping 192.168.1.1 -c 1 || echo 'Server reachable' uses || which runs echo on failure, not success. ping -n 1 192.168.1.1 && echo 'Server reachable' uses Windows syntax -n. ping -c 1 192.168.1.1; echo 'Server reachable' always echoes regardless of ping result.