Introduction to Data Communications
Previous 51. Quick Introduction to UNIX (cont'd) Next

File Naming Conventions

Once again Unix is case sensitive which is a difficult area to get used to when you migrate from the DOS environment.


File Name Length

Unix allows up to 255 characters in the file name as opposed to DOS's 8.3 convention. This allows for unique and informative file descriptions rather than the encryptic file names used in DOS.

There is a problem with having long file names if you are working from the command line. Typing in a file name with 255 characters and keeping the case correct can be very frustrating. It is recommended that you keep the file names short and sweet and also use DOS's naming convention if you are going to transfer files between DOS and Unix (very common occurrence).


Allowable Characters in Filename

Only the "/" (forward slash) is not allowed in filenames because it is used as the pathname separator (DOS uses the back slash "\").

Characters to avoid: ? @ # $ ^ * ( ) ` [ ] \ | ; ' " < >

You can use spaces or tabs in filenames if you enclose the names in quotation marks on the command line but they are hard to work with. Use underscores or periods to get visual separation.

Ex. "this is my file" or my_file_is_this_one or here.is.another.file

Don't use - or + as the first character of a filename. Many commands use the - or + to introduce options or switches.

Filenames starting with "." are used by the system to make names invisible to normal directory listings. Typically, preferences or configuration files are "hidden" using a "." prefix. An example is ".signature" used for your electronic signature in E-mail.


Pathnames (/)

Unix uses the forward slash "/" as the pathname separator. Unix's top directory is called the root directory and is indicated by "/".


Introduction to Data Communications
Previous Table of Contents Next