Linux Executable File types (was Re: Hi)

Andrew Farris flyindragon1 at aol.com
Wed Dec 16 10:03:31 UTC 2009


On Wed, 2009-12-16 at 12:22 +0530, Ajay Kumar Karn wrote:
> Quoting ramesh gandhi <ramesh.kbvr at gmail.com>:
[snip]
> > 2)what are the executable files in Ubuntu.
[snip]
> (2) In linus .sh are the executable files.

Just to clarify... There are several different kinds of files that can
'execute'... so it depends on what type of execution you're talking
about.

Here's a list of everything I could think of:
     1. Standard ELF Files - Executable Linux Files are binary
        executables, like .exe files. These typically don't have an
        extension, but they can... you may encounter these with a ".bin"
        extension used as installers 'universal linux installers' from
        some software vendors, but they are actually the exact same
        thing. These can be run by simply calling them from the
        terminal.
     2. ".sh" files -- These files are a class of 'executable text
        file'... in the loosest sense, '.sh' files are just like '.bat'
        files on windows: it's just a 'shell script'. Basically when you
        'execute' one of these files, your shell just runs and
        interprets each line in the file as though it was entered into
        the shell itself. These are useful for writing short programs to
        automate tasks, or to conveniently group commands you use
        frequently.
     3. ".run" files -- These are another 'executable text file' that
        are often used as installers for programs. These are interesting
        though, because they're actually a mix between a shell script,
        and a binary data blob... similar to a self-extracting archive
        on windows
     4. ".py", ".pl", ".rb" -- These are also executable text files,
        python, perl, and ruby, respectively. They are basically scripts
        that are run by an interpreter program but can be given
        executable permission so you don't have to explicitly call the
        interpreter when you want to run them (i.e. rather than calling
        "python ./program.py", you can simply call "./program.py". NOTE:
        these programs can also be extension-less).

There are numerous other file formats, such
as .gz, .bz/bz2, .tar/tar.gz/tar.bz2, .deb, etc that are commonly
mistaken for executables, but these are actually just various archive
files, and when you attempt to 'run' them, they open up whatever program
is suitable for opening them (usually an archive manager).

Hope that helps :)

-- 
Andrew
_____________________________
Registered Linux User: 473690
Registered Ubuntu User: 22747





More information about the ubuntu-users mailing list