What is the equivalent of a binary executable (exe) as in Windows for Linux?

What is the equivalent of a binary executable (exe) as in Windows for Linux? by @t3nsor

Answer by Brian Bi:

Linux does not use file extensions to distinguish executable files.

When you try to execute a file, the kernel first checks whether you have permission to execute the file. This is determined by the filesystem permission bits. (Example: a file with permissions 0644 can't be executed by anybody.) If this check fails, no further processing is done.

If you really do have permission to execute the file, then the kernel searches for a handler that recognizes the executable format. All modern Linuxes will recognize the ELF executable format; some may have support for the old a.out format [1] or other, more obscure formats. Wine installs a handler that is capable of executing Windows .exe files. In addition, all Unix-like systems, including Linux, will recognize the shebang line (beginning with #!).

If there's a handler that recognizes the file, that handler parses the program headers, loads the image into memory, and so on. If not, an error is returned.

For technical details, see [2]

[1] Note that the file a.out produced by the C compiler is not necessarily in the a.out format; the name is a historical relic.
[2] http://www.linux.it/~rubini/docs…

What is the equivalent of a binary executable (exe) as in Windows for Linux?

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s