ping problem in Terminal

Hey folks,

I've been having a problem with my Terminal window on one of my Mac laptops - the MacBook 15" white model running the latest Snow Leopard. I install developer software and use the command line quite a bit, so you might imagine this problem has been quite frustrating. I haven't been able to use ping! Here's what I see:

-----------------------------------------

INYC-MacBook-2:~ stevewarren$ ping www.google.com
usage: ping [-AaDdfnoQqRrv] [-b boundif] [-c count] [-G sweepmaxsize] [-g sweepminsize]
[-h sweepincrsize] [-i wait] [-l preload] [-M mask | time] [-m ttl]
[-p pattern] [-S src_addr] [-s packetsize] [-t timeout]
[-W waittime] [-z tos] host
ping [-AaDdfLnoQqRrv] [-c count] [-I iface] [-i wait] [-l preload]
[-M mask | time] [-m ttl] [-p pattern] [-S src_addr]
[-s packetsize] [-T ttl] [-t timeout] [-W waittime]
[-z tos] mcast-group
INYC-MacBook-2:~ stevewarren$

-----------------------------------------

I get the same result when I ping another computer on my local network with it's IP number. When I ssh into that machine, which proves it actually exists on my network, I can ping www.google.com and get the results I expect to see on my Mac laptop. Something like:

Reply from 98.137.149.56: bytes=32 time=97ms TTL=49

If anyone could shed some light on what might be causing this, I'd be very thankful in advance!

Happy Halloween.

-steve warren

MacBook 15" White, Mac OS X (10.6.4)

Posted on Oct 31, 2010 7:07 PM

Reply
2 replies

Oct 31, 2010 7:53 PM in response to interactivenyc

Terminal and Unix questions are best asked in the Mac OS X Technologies > Unix Forum
<http://discussions.apple.com/forum.jspa?forumID=735>

Are you sure you are running 'ping', and not a script called ping, or an alias called ping?

Start with:

/sbin/ping www.google.com

If that works, then you might want to see what 'ping' is invoking

/usr/bin/which -a ping
/sbin/ping

and try

alias ping
bash: alias: ping: not found

So the 'ping' command should be found in /sbin/ping and there should not be any aliases for the ping command. And /sbin/ping should work.

Nov 14, 2010 4:20 PM in response to BobHarris

Thanks Bob!

/sbin/ping www.google.com worked like a charm, so I tried the which statement and found it was using /sbin/ping. Then I checked my aliases and found that I had an entry: alias ping="ping www.google.com"!

I must have done that late one night when I was having network issues, and forgot all about it. Your method for discovering the problem was awesome!

-steve

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.

ping problem in Terminal

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