How to solve: -bash: : cannot execute binary file
Sorry, this file is for GNU/Linux
According to your file
output, this program is for GNU/Linux. I know this because:
- The file
b1
is in theELF
(Extensible and Linkable Format) format, while Mac OS X uses theMach-O
format for binaries; file
recognizes this file is forGNU/Linux 2.6.18
, meaning it'll work on most modern Linux distributions.
To solve your problem, you must either run this problem within a Linux distribution, recompile the program, or get the Mac OS X version of this program.
So... Why doesn't b1
work on XYZ OS or CPU?
Just as people speak different languages, different computers understand different instructions. For instance, your Mac uses an Intel processor, while your Android phone uses an ARM processor. Compare these two processors to English and French. They may belong to the same language family, but still, you can't speak both at the same time. This leads to a conclusion:
Dissimilar computers "talk" in different tongues.
As for why different operating systems (such as Windows, Mac OS X, and Linux) can't use the same binaries, consider this:
What makes software objectively different to hardware? Not much.
Both provide a system and a "language" that allows for more complex components of the computer to complete tasks for the end user. Both require an agreed language to get work done. Imagine if there were 10 people in a shouting match, each speaking a different language. This is why different OS software need different binaries, even if both operating systems use the same processor.