Reputation: 1273
Whenever I go into a terminal and type "ping X" with X being an address, I get
"command not found"
I can't even locate where Ping is, I've looked in /usr/bin
and /usr/sbin
. I don't even know where it's installed.
$PATH = /Library/Frameworks/Python.framework/Versions/2.7/bin:/usr/bin:/bin:/usr/local/smlng/bin
Upvotes: 1
Views: 11843
Reputation: 559
If the command which ping
and echo $PATH
give you nothing in terminal, maybe the ~/.bash_profile
miss the default paths.
Here is the way to check and repair it.
vim ~/.bash_profile
PATH=/usr/bin:/bin:/usr/sbin:/sbin
PATH=/usr/bin:/bin:/usr/sbin:/sbin
) in to the .bash_profile
file (Steps below will show you how to modify the file)Steps for modify the file with vim
:
:wq
, you will save the file then quit the vimUpvotes: 7
Reputation: 251
On a fresh Mac OS X (10.9) install, running the which ping
command will yield the following default location:
/sbin/ping
Let's take a look at the default $PATH values for a fresh install of Mac OS X (10.9) using the command echo $PING
we see the settings as:
/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin
Now, looking at your $PATH variables, it looks like you are missing the following entries:
You should be able to fix this by following these steps:
sudo nano /etc/paths
Y
to save the modified buffer.You should then be able to use ping
, ping6
, umount
, and a number of other commands for programs located in the sbin directories that you weren't able to. If you are still receiving errors, you may need to reboot.
Upvotes: 8