We should note here
that a directory is merely a special type of file. So the rules and conventions
for naming files apply also to directories.
In naming files, characters
with special meanings such as /,*,&,% etc.,
should be avoided. Also, avoid using spaces within names. The safest way
to name a file is to use only alphanumeric characters, that is, letters
and numbers, together with _ (underscore) and . (dot).
File names conventionally
start with a lower-case letter, and may end with a dot followed by a group
of letters indicating the contents of the file. For example, all files consisting
of Pascal code may be named with the ending .p, for example, prog1.p
. Then in order to list all files containing Pascal code in your home directory,
you need only type ls
*.p in that directory.
Beware: some
applications give the same name to all the output files they generate. For
example, some compilers, unless given the appropriate option, produced compiled
files named a.out. Should you forget to use that option, you are
advised to rename the compiled file immediately, otherwise the next such
file will overwrite it and it will be lost.