In Linux (and UNIX-like systems), a binary is a compiled executable file—meaning it’s machine code that the system can run directly. It’s the output of compiling source code (like C or C++) into an executable format.
âś… Are binaries the same as programs?
- Yes, usually. When you run a program like
ls
,nano
, orpython
, you’re typically running a binary file somewhere in the filesystem (e.g.,/bin/ls
). - However, “program” is a broader term. A program could be:
- A compiled binary (e.g.,
/usr/bin/firefox
) - A script (e.g.,
/usr/bin/pip
, which is a Python script) - A shell function or alias (like ll being an alias for
ls -l
)
- A compiled binary (e.g.,
So: 🟢 All binaries are programs, but 🔴 Not all programs are binaries. Some are scripts.