Mar 191999
 

Command not found

This article deals with what to do when you get the above error message but you can see the command and you know it works

Background

I had just finished Installing the lynx port from the Internet and was trying to run lynx.  But I encountered the following problems:
kennett# lynx
lynx: Command not found.
kennett# which lynx
lynx: Command not found.

But lynx was at /usr/local/bin and had the correct file permission:

-r-xr-xr-x  1 root  wheel  823640 Mar 15 21:39 lynx

The fix

I was able to run it by issuing the following command:
kennett# /usr/local/bin/lynx

I initially thought that /usr/local/bin was not in my path.  But it was as evidenced by the following:

kennett# echo $PATH   
/sbin:/bin:/usr/sbin:/usr/bin:/usr/games:/usr/local/bin:/usr/X11R6/bin:/root/bin

I was running as root, so I issused the following command:

source ~root/.login

After that, I was able to run lynx by just typing lynx

Postscript

I’ve since been told that doing a rehash would solve the above problem.   See man csh for details.

  2 Responses to “Command not found”

  1. Would the ‘rehash’ command have done the trick (if you were using a ‘csh’-flavoured shell)?