Linux CLI - Networking Commands
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?192.168.1.1 once and returns success if reachable?-c 1 option sends exactly one ping request in Linux.&& operator runs the echo command only if ping returns success (reachable).|| 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.15+ quiz questions · All difficulty levels · Free
Free Signup - Practice All Questions