21
zsh: exec format error... 

his is the error I was getting when trying to execute a large application. I am using redhat Linux.

What can I do to solve this?

user91095
  • 221
  • 4
    What is the output of file for the file you're trying to execute? (file <filename>) – Flup Nov 11 '14 at 10:34
  • 3
    A quick Google shows that this can be caused when you attempt to run the incorrect architecture application - for example, attempting to run a x64 application on a 32-bit distro. With so little information in your question, it's very difficult to guess what your particular cause is. – garethTheRed Nov 11 '14 at 11:41
  • // , Note that this is error number 8. – Nathan Basanese Sep 04 '15 at 21:06

2 Answers2

29

The file that you're running has been given the execute permission, but it isn't in a format that the kernel understands, so it can't be executed on your machine.

Run file /path/to/the/executable to see what kind of a file it is.

This could be an archive that you're supposed to extract, or an executable for a different architecture (e.g. a 64-bit executable on a 32-bit system), or anything else really.

  • The problem was that I started downloading an installer (executable sh file) and executed it but it wasn't done downloading (size was 637 MB!) so yeah – xjcl Oct 24 '18 at 14:52
1

I solved this issue in shell script, by switch the file's line separator to \n, then it works for me.

Jeff Schaller
  • 67,283
  • 35
  • 116
  • 255