"Command not found" no matter full path or relative or none yet...
Is there something special about /usr/local/bin.
This happens both with scripts and binary executables. I can ls, and "which" and "whereis" show me the exe file but when I try to run it says "Command not found". I have done "rehash" and also logged out and back in. A binary exectuable called for example "sr" gets this: # sr ls sr: Command not found. # ./sr ls sr: Command not found. # ls sr sr # whereis sr sr: /usr/local/bin/sr # which sr /usr/local/bin/sr # /usr/local/bin/sr ls /usr/local/bin/sr: Command not found. I also made a simple csh script in the same dir, that just echos "this is here" to the screen. it acted normally, where it was "not found" but I could call it with ./ prefix, and after I did a "rehash" could just call it. Also /usr/local/bin is first in my PATH. Anyone run into this before? |
Could you please do a:
ls -ld /usr/local/bin/sr Also, purely to check: echo $PATH Just a note that, in your examples, you should show which current working directory you're calling the various commands from. |
additionally:
file /usr/local/bin/sr and head /usr/local/bin/sr if that was a readable text file. |
Any particular reason you are the root user here?
There is nothing more special about /usr/local/bin than any other directory. I also would like to see the output of the ls -ld command hydrurga has asked you for and your $PATH variable in support of your comment that /usr/local/bin is in your path. Seeing the long listing of that file will tell us who owns it, what group it is in, and what the files privileges are. |
yeah I've had this happen to me with something else - it was there but when ever I tried to use it - it'd tell me the same thing, I did the same searches you did seeing it was there then I just got tired of trying to figure out why it would still not work and just reinstalled it. that fixed that problame toot sweet. ;) someone than suggested after I did this to check it with stat. but it was too late by then.
|
Quote:
I was root because there was a need to be for the work I am doing. I'm on my way out and it is on a different machine that isn't connected to the internet, so please take my word for it, FIRST in my path is (spelled correctly) /usr/local/bin Besides, it is a moot point. I can see the command. As I said if I call it with full pathname it still doesn't use it. "sr" is a binary executable. I'm having the same thing with scripts as well. |
Quote:
I and pan64 have both asked you to provide output from various commands in order to troubleshoot. You might also add the stat command implied by BW-userx's post. If you won't help us, we can't help you. |
Once again, some important ls -l information would be file ownership and permissions.
It is very common for any or all of us, including yourself, to have something unexplained hit us, and then we have a viola moment where we realize we overlooked something. Therefore when you have the time to look further into this, perhaps you can check this information. We do understand that you cited other applications or scripts. Therefore perhaps something changed to the permissions or ownership of the /usr, /usr/local, or /usr/local/bin trees. I would check those as well. |
*nix systems are intentionally vague about permission errors. They use "file not found" or "command not found" when the user doesn't have permissions, which is why we're asking to see ls -l...it will show us the permissions.
A point of experience: I always use ls -l to look at files. A simple ls tells me nothing about the file other than it appears to be there (it could, for example, be a link to another file that is not executable -- something I'd never know unless I did a long listing) |
Quote:
|
All times are GMT -5. The time now is 04:16 PM. |