Ubuntu – Command not found but file exists


I know this has been a common problem but the answers provided to other questions haven't helped with my current issue.

When trying to run a file called srf2obj I get the "command not found" response.

I can see that the file is there. "file srf2obj" returns:
GNU awk script, ASCII text executable

OS is installed on Virtualbox.

Any help would be great, thanks.

Best Answer

When you type srf2obj, the shell checks to see if srf2obj is an alias, a shell function, or (this is what you want to happen) an executable file in one of the directories in your $PATH, or, if you specify a path to the file (/home/walt/bin/foo, ./srf2obj) it will try that.

If ls -l srf2obj shows that it is executable, try typing ./srf2obj. If not, make it executable via chmod +x srf2obj. If you are going to do this a lot, consider adding this directory to your $PATH.

Or, you could invoke the interpreter directly, thusly: gawk srf2obj

Related Question