Newbie question about difference between executable file and ordinary file

Hi,

I am newbie in unix and just started learning it. I want to know what is the difference between an executable file and a file (say text file). How to create executable file? What is the extension for that? How to differentiate ? How does it get executed?

Thanks

Hi,

Welcome to the Unix world.

Your question is a bit general..
So I'll start with a tip:
Unix has a command called "file".
you type : file filename
and get seme info what type of file it is...is it text file?
executable? what kind of executable ?

Executable file is a file that can be run and perform some computing task. (hope that's close to the academic definition)

All executable files need to have permission +x turned on in order to be run.

Unlike text files and scripts (files written in readen language which can also be run), executable files are mosty referd to binary files, their content is not readable to humans and contains directions in binary format for the machine to run.

To run an executable file you simply type its name.
to create an executable you need some sort of compiler to create binary code.
For an executable SCRIPT. you should edit your code and follow the format it uses.All scripts first line should start with calling the interpter line like these examples:
#!/usr/bin/perl
#!/bin/sh

Hope that helps,

Hezki