Link to home
Start Free TrialLog in
Avatar of Jebtrix
Jebtrix

asked on

Can't run executable with file and directory permissions set for executable

Just started poking around some linux distros (knoppix, libranet, mandrake) and I'm mystified why I cant run a small 'hello world' kind of executable. I chmod'd the file and directory to 777, tried doing it with root account, all I get is a command not found errors. Doing a ls -al I can see that the file and directory do have executable permissions. Bash recognizes the file as an executable by showing it in green. The file is in my /home directory. I finally got it to work by using root and placed the file in my /sbin directory. What is preventing me from running under /home ????
Avatar of Jebtrix
Jebtrix

ASKER

Nevermind I figured out I needed the full path name unless its in $PATH. Let me rephrase the question, is there anyway I can run the executable without full path and without adding current directory to global $PATH var? Like autoappending path if file is in current folder or something along those lines.
ASKER CERTIFIED SOLUTION
Avatar of brettmjohnson
brettmjohnson
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Don't forget to remove the test executable from /sbin & change the directory permissions back to 755 -
It's not too important if only you use this machine, but it''s never too early to learn good habits ;-)
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Hi, did any of these answer reply to your question ?
IMHO - brettmjohnson gave the first valid answer, but Alf666 gave an excellent tutorial on paths & permissions.  Unless Jebtrix wants to request a refund at https://www.experts-exchange.com/Community_Support/  I suggest splitting the points between them ;-)
Avatar of Jebtrix

ASKER

Thanks for the added depth Alf666.