When I try to run any executable file a file not found error occurs. Sometimes it says nothing but doesn't do anything.

For example, when I execute ./blah-blah.bin it fails finding the file when it is clearly there. When I execute ./blah-blah-file-2.sh, it is silent.

Note 1: files have +x.
Note 2: root also cannot execute.
Note 3: everything from /usr/bin executes.
Note 4: I can't try it from GUI, I have only access to its console.

What's the problem?

Upd: suddenly some commands (e.g. ls) begin fail with a file not found. They worked yesterday...

  • Please post the first couple of lines of that file (I'm betting it doesn't contain the #! path to a valid shell). – Cry Havok Dec 24 '11 at 22:37
  • The output of file is the better thing to ask for, as below. – JdeBP Dec 25 '11 at 0:13
  • ./alfresco-install.bin: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.2.5, stripped – Alexey Dec 25 '11 at 7:43
  • You wouldn't happen to be trying to execute a 32bit binary on a 64bit OS without 32bit support packages? Without the ia32 libs you wouldn't get very far on AMD64... – user268396 Dec 25 '11 at 12:23

Check the mount options, specifically, whether it is mounted noexec.

If this is the problem, e.g. on /tmp, do

sudo mount -o remount,exec /tmp
  • mount: /tmp is not mounted or invalid option – Alexey Dec 25 '11 at 7:52
  • @Alexey: ahem. <spelling-it-out> e.g. means 'for example'. You need, of course, to inspect the mount point that contains your binary). I think df . in that directory will help – sehe Dec 25 '11 at 10:03
  • To just list all mounts, enter... mount – sehe Dec 25 '11 at 10:04
  • a noexec mount would fail with operation not permitted rather than file not found. – Shadur Jul 9 '19 at 21:06

Is it a script or a binary executable?

If it's a script, check the #! line.

Depending on your shell, the error message for a command with a bad #! line can refer to the script rather than to the missing interpreter.

For example, using tcsh:

% cat foo

echo hello
% chmod +x foo
% ./foo
./foo: Command not found.

Using bash, the error message is different:

$ chmod +x foo
$ cat foo

echo hello
$ ./foo
bash: ./foo: /bin/no_such_interpreter: bad interpreter: No such file or directory

Even if the #! line looks ok, it can fail if there's a \r character at the end of the line, which can often happen if the file was created on Windows. What does

head -1 blah-blah.bin | cat -A

show you?

If that doesn't solve the problem, show us exactly what command you typed and the error message that resulted.

EDIT : I realize your title suggests it's a binary executable. Exactly what kind of file is it? What is the output of

file blah-blah.bin


  • The script installs from binary. I can execute that binary and script everywhere except one conctrete linux. – Alexey Dec 25 '11 at 7:57
  • Even if the #! line looks ok, it can fail if there's a \r character at the end of the line +1 I fell into this trap, just now, again (happens way too often) – Amani Kilumanga Jan 15 '16 at 2:22


ldd ./alfresco-install.bin

and check the output. This sounds suspiciously like it's missing a dynamic library or two.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.