Syntax for sending 1 ping via Terminal?

I think the subject line (which reminds me of a scene from The Hunt for Red October) says it all.

iMac G4, OSX 10.3.9, AE V5.7, AX V6.3, AE card V405.1 (all b/g), AirPort Admin Util 4.2

Posted on Nov 27, 2008 3:36 AM

Reply
12 replies

Nov 27, 2008 3:43 PM in response to Dave Post

Back to the real world, I just looked around on my HD and found Network Utility.app in /Applications/Utilities. I'm running Tiger now, but Panther probably includes this utility as well. My version has a Ping tab, and you can send any number you want, including just one.

If this fits your needs, you may not have to deal either with Vasily or with Terminal...

Nov 27, 2008 5:50 PM in response to Dave Post

Hmm, I have an old disk image of a prior 10.3.9 installation, and it does have Network Utility.app in its Utilities folder. I then looked at my original iMac G5 Panther install disks with [Pacifist|http://www.charlessoft.com>, and it's in there also. Maybe Pacifist could find and install a copy for you from your own Panther install disk. Others may have additional suggestions.

In any event, Happy Thanksgiving to you also, and good luck!

Nov 27, 2008 9:28 PM in response to jsd2

Give me a ping, Vasily. One ping only, please. ...
for some reason the original poster had problems with the Give command. The following procedure will implement the Give the command. Please note the commands are case sensitive. Also, you may wish to delete this command when you were done with it since it is in a system directory.

You should substitute your network name for ... .

Macintosh-HD -> Applications -> Utilities -> Terminal
in terminal, type
mac $ cd /sbin
mac $ pwd
/sbin
mac $ ls -l Give
ls: Give: No such file or directory
# verify that they Give command does not yet exist.
# since we are in a system directory we need to use sudo to access
mac $ sudo pico give
Password:

Hit return, and type in your password. When the editor comes up, type in these lines:

let "m = $# - 1"
shift $m
echo '$1=' $1
ping -c 1 $1

Control-O and Return to save, Control-X to quit.

mac $ sudo chmod 755 Give
mac $ ls -l Give
-rwxr-xr-x 1 root wheel 58 Nov 28 00:12 Give*

mac $ Give me a ping, Vasily. One ping only, please. google.com
$1= google.com
PING google.com (74.125.45.100): 56 data bytes
64 bytes from 74.125.45.100: icmp_seq=0 ttl=239 time=33.904 ms

--- google.com ping statistics ---
1 packets transmitted, 1 packets received, 0% packet loss
round-trip min/avg/max/stddev = 33.904/33.904/33.904/nan ms
mac $
mac $ Give google.com
$1= google.com
PING google.com (74.125.45.100): 56 data bytes
64 bytes from 74.125.45.100: icmp_seq=0 ttl=239 time=33.719 ms

--- google.com ping statistics ---
1 packets transmitted, 1 packets received, 0% packet loss
round-trip min/avg/max/stddev = 33.719/33.719/33.719/nan ms
mac $ man ping

Robert

Nov 27, 2008 10:08 PM in response to rccharles

Is there something about Thanksgiving that's bringing out the joker in people today?

Hmm...no, more likely it's just the type of people who would be hanging around their computers, posting to forums like this, etc. on Thanksgiving. 😉

Well, that's very clever, Robert. I'm going to keep that command around so I can amuse my friends (and do single pings from Terminal).

Mr. Terminal (who's been released from his quarters), Ms. Mouse, and I say "Thank you!"

Nov 27, 2008 10:36 PM in response to Dave Post

Dave, glad it worked. 🙂
Pacifist is a great program - I think even Scotty would approve of it.

Robert, thanks for the new "Give" command, and especially for the lesson on how to construct such things. Back at square one, I gather from your post that the underlying Terminal command for say, Google, would be
-----------
ping -c 1 google.com
-----------
That's only for use when Vasily is not around to "give" an order to, of course...

Nov 28, 2008 8:09 PM in response to jsd2

-----------
ping -c 1 google.com
-----------

This command sends one ping to the given network address.

You may read about the ping command in the manual. The description will be cryptic to say the least.

Macintosh-HD -> Applications -> Utilities -> Terminal
man ping

type q when done

jsd2, I did not want to give of the command syntax too easily because I enjoyed reading your first post.

Robert

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

Syntax for sending 1 ping via Terminal?

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.