On Sat, 27 Apr 2002, Samuel W. Heywood wrote:

> One of the nice things about DOS files is that most of them
> have file extensions so as to give the user some idea as to
> what kinds of files they might be.
> 
> Most of the files we see in a Linux distribution and many of
> the files we find on a Unix host have no file extensions.  We
> have no immediate clue as to what kinds of files they are.
> 
> Why?

  Many files do have such extensions.  Look in /etc.
You'll probably find lots of files with .cfg, .conf, or 
.config extensions.  Can you guess what these are for?

  All the html files on my web server have *html extensions.  
If I want to include PHP in the web page, then it needs to 
have a .php3 on it.
  Compressed packages have .zip, .gzip, .tgz, tar.gz, etc. 
extensions.  Red Hat packages have .rpm extensions.  Debian 
packages have .deb extensions.
  Sound files have .wav, .mp3, .ogg, .au, etc.
  Multi-media have .avi, .mpg, .ppt, etc.

  In DOS, files are grouped according to their "package."
IOW, all the arachne files will be found under C:\ARACHNE.
In order to differentiate what all those unorganized files
are for, extensions are handy.

  'nix systems organize files according to function.
Configuration files are in /etc.  Executables will be
in /bin, /usr/bin, /sbin, /usr/sbin depending on what
type of programs they are.  If you're running a GUI,
you'll also find executables in /usr/X11R6/bin/.  Matter
of fact, any time you're in any directory ending in /bin,
the files within will be executables.

  And yes, some executables have extensions that let you 
know what kind of executable they are.  You can have .cgi,
.sh, .pl, .php3, .py, .jar, etc.

  In order to tell for sure, use 'ls -l' for a full
directory listing instead of just filenames.  That
tells you who has read, write, and execute permissions
for that file.  If there are no x attributes, the 
file is not executable.  Some files are executable only
for their owners, while some are executable only by their
groups, and others by anyone.

  Of course, in your home directory, you can have whatever 
kind of (dis)organization you wish.

  On many distributions, filetypes are color coded. 
When I do ls, or any derivative, all executable files
are shown green.  Tarballs, rpm files, and anything
compressed, shows up red.  Directories are blue. 
Graphic files are magenta.  Links are teal.

  In many Linuces, it is IMMEDIATELY obvious what any 
filetype is without even looking for an extension... so 
extensions are often redundant because of the directory 
you're in, and then doubly redundant when filetypes are 
color coded.

  When it makes sense, use them.  When I write out files
from Word Perfect, I add either a .wpd or .ps suffix
so I'll know later what "reader" to use for it.
When I create plain ascii files, I use a .txt extension.

  Bottom line is pre-existing files without extensions
really don't need them, and any files you add can have
them or not, depending on your preference/requirement.

--
Steve Ackman
http://twoloonscoffee.com       (Need green beans?)
http://twovoyagers.com          (glass, linux & other stuff)

Reply via email to