file exists but can not run it.
hello everyone,
i have "authkey" file under /usr/bin when i type "authkey" command on console it returns me "bash: /usr/bin/authkey: No such file or directory" error. this happens for some other files too. what is wrong here please help me. |
You can only run /usr/bin/authkey if its permissions mark it as executable.
Do the following at the command line: (Remember "$" indicates a user prompt, "#" indicates the super-user prompt) Code:
$ su EDIT: Keep in mind, not all files can be executed once their permissions have been changed. Some files are not necessarily programs - it could just be a plain text file, in which case even if you make it executable, you won't be able to run it. |
This sounds more like a $PATH issue than permission denied. Post the output of echo $PATH. It would also be interesting to see ls /usr/bin/auth*. Is it possible you are running a restricted shell?
Bill |
Most programs are installed to /usr/bin, and 99% of the distros out there have /usr/bin in the users' PATH env. variable - so I don't see that being an issue. But it's always worth a shot.
|
Quote:
So either the command was typed incorrectly, the file is not executable, or the shell is somehow restricted. I think that authkey probably isn't in /usr/bin. Code:
which authkey |
i am running in su mode and i have done all u said.
it is on the PATH i know here are the results of your advices. linux:~ # ls /usr/bin/auth* /usr/bin/authkey linux:~ # ls /usr/bin/auth* /usr/bin/authkey u see it is on the path but it gives no such file or directory errror linux:~ # authkey -bash: /usr/bin/authkey: No such file or directory where is the problem? |
I think I know what it might be. Is /usr/bin/authkey a symbolic link? The link could be there, but the actual file it is pointing to is missing. Try ls -al /usr/bin/authkey, and see what you get.
Code:
[root@peanut root]# ls -al /usr/bin/hello [root@peanut root]# hello -bash: /usr/bin/hello: No such file or directory Bill |
The which command will search the $PATH to find out which file (if any) will qualify as a command.
Enter: which authkey. The command will tell you if a qualifying file exists. If not, there is a $PATH issue. If so, there's an execute-permission issue. Also note (as an aside): if the file you wish to run is in your current directory, Linux/Unix normally does not include that directory in your path. You must prefix it with ".'" to run it. ("." is a reference to "the current directory.") This is done so that you must explicitly (and therefore, presumably, knowingly and intentionally) request to run any program that is "right here," lest someone slip a program into a directory in hope that you will accidentally run it instead of the command you intended to use. |
All times are GMT -5. The time now is 06:05 PM. |