0

This is something dumbfounded on me. I am trying to run a program found in current directory and I keep getting "command not found" despite being right in the current directory.

I have tried "./program.bin", ".program.bin", and "/program.bin" but it still generates an error saying no command found despite being right in current directory. Remember, this is not a program found in bin folder, it's only found in current directory I am in.

Why? I am on Lubuntu as well and I get the same error. Is there a requirement that I have to somehow "install" the program.bin to make it run? Or what?

UPDATE: found that it cannot run because it's not an executable until you selected "Make the file executable" in permissions dialog.

3
  • 2
    If you do ls -l on the program what are its attributes and ownership? It may not be marked as executable, at least by you. May 1, 2019 at 22:40
  • Yep, that's because it was not treated as an executable file. I selected "executable" in properties of file and it started as an executable.
    – netrox
    May 1, 2019 at 22:55
  • Is "command not found" the entire message, with no other information prefixing it? May 2, 2019 at 1:30

1 Answer 1

1

You have to make the program executable first by issuing the following command

chmod u+x program.bin

This adds the executable bit for the user

if the executable flag is not set then you can usually run most commands by calling bash like so

bash ./program.bin

however since this is a .bin file I am not sure how the previous command would work. It would be better to add the executable bit

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .