What is the equivalent of an "exe file"?

Solution 1:

Linux extension Windows Equivalent Short description
.so, .o .dll Object that can be loaded at runtime (Similar to DLL)
.a .lib Static library
[none], .elf(rare), .exe, .com(rare) Linux executables
.bin(rare)
.sh .bat Shell script
.exe .exe Mono application, Wine application
.deb .msi Installer package for Debian/Ubuntu releases
(Though .deb is much more powerful with native support for dependencies and repos). Note that .deb is actually a .tar archive with a special control file, a special file order, and a different extension.
.rpm .msi Installer package for RedHat/CentOS releases.
.tar.gz, .tar, .gz .zip Compressed files that can contain a program or any other data, like images, documents, etc
.ko .sys Drivers and kernel modules are loaded into the Linux kernel and have more hardware access than other programs.
.sh, .php, .py, etc .bat, .cmd, .vbs, Linux is capable of running any file that it has an interpreter for.
.js A line at the top of the file called the shebang specifies what interpreter to run the file with.
Windows only supports .bat and .cmd files as Batch files, and .vbs (vbscript) and .js (JScript, not to be confused with JavaScript) via the Windows Script Host (WSH).

Solution 2:

There is no standard File-Extention like an ".exe" file in Windows.

On Linux nearly any file can be executable. The file ending just describes (but not necessarily) what or how a file is "executed".

For example a shell script ends with .sh and is "executed" via the bash shell.

In your question you ask for .deb and .tar.gz Well, the .deb file installs software on your system (Please be careful!) And the .tar.gz file is a compressed file like a .zip that you could know from Windows.

Solution 3:

The concept of an executable is different in unix/linux than Windows.

Windows

Anything that ends in .exe or .com becomes an executable file.

Linux/Unix

Each and every file has an executable bit, so any file can be executed, unlike Windows. To see if a file is executable, you can check its properties (Permissions tab), or even see them marked in the terminal (they are all marked with a *).

Even text files (like shell scripts) can have their executable bits set, and be run as one.

Solution 4:

To find out what a UNIX operating system thinks a particular file's type is, you use the file command:

$ file /bin/ls
/bin/ls: ELF 32-bit LSB executable, Intel 80386, version 1, for OpenBSD, statically linked, stripped

In the above example, I give the path to the program 'ls', you would replace with the path of your file.

A script file would look like:

$ file script.sh
script.sh: Bourne-Again shell script text

A random text file:

$ file textfile
textfile: ASCII text

An archive file:

$ file rsync-3.0.6.tar.gz
rsync-3.0.6.tar.gz: gzip compressed data, from Unix

It is even smart enough to correctly identify a windows program, should you happen to have one lying around on your UNIX box:

$ file FMZsetup.exe
FMZsetup.exe: MS-DOS executable (EXE), OS/2 or Windows

And when it can't figure out what a file is (but is able to open it), it calls it data:

$ file myrandom
myrandom: data

Solution 5:

File execution on Linux isn't related at all to the file name or extension. Any file can potentially be executed, provided that it's handled by the kernel's binfmt mechanism (and that its executable permissions are set).

The most common format for executable is ELF, although some kernels can be compiled for support of the old a.out format. (For full technical details, binfmt_elf.c is where to look.)

Another common mechanism is the "Shebang" system, handled by binfmt_script, which looks for #!/path/to/interpreter at the beginning of the file.

binfmt_misc allows for the registration of other handlers, as documented here.

If you fancy doing a bit of kernel programming, you can even write your own.

Although not directly related, the file command should tell you whether a file is an ELF executable or something else.

The naming convention has nothing to do with the executable status of a file (except when it's used for binfmt_misc registration). They're just conventions. Typically, a .exe file found on Linux could be a mono application, getting the .exe extension as a convention coming from the Windows/.Net world.

The other aspect that can happen when you want to "run" a file is to have the file explorer tool that you use register extensions to be able to launch a program that will open these files. This is what would happen if you double click on a .txt, .tar.gz or .deb, for example: the files are not executables nor executed, but what you use to double-click chooses which executable to launch to open these files.