LINFO

Dot Definition



The dot, which is the same character as the period, has several important roles in computer software.

Perhaps the most familiar to most computer users is to indicate the start of a filename extension. This is a short string (i.e., sequence of characters) that is added to the end of the base name (i.e., the main part of the name) of a file or directory in order to indicate the type of file or directory. Extensions are used for all files on the Microsoft Windows operating systems, although the systems are often configured so that they are not visible to users. Extensions are not necessary for most types of files on Linux and other Unix-like operating systems.

Dots are also used in all URLs (universal resource locators), which are addresses of documents and other resources on the Internet. They are used to separate the protocol (e.g., www or ftp) from the domain name (e.g., yahoo.com) as well as in the domain name extension (e.g., .com or .org). In addition, virtually every web page has an extension that is preceded by a dot (e.g., .html or .php), although web servers are typically configured so that the extensions are not visisble for some pages, particularly home pages.

Another major, but less obvious, application of dots is as a prefix for the name of a filesystem object (i.e., file, directory or link) to indicate that it is a hidden file, hidden directory or hidden link. A hidden filesystem object is one which is not visible to users by default when using a command such as ls (which is used to list the contents of a directory) or viewing the icons that represent the contents of a directory in a GUI (graphical user interface). The main reasons for making objects hidden are to reduce visual clutter and to minimize the chances of accidental damage to critical system files by users.

On Unix-like operating systems every directory contains, as a minimum, an object represented by a single dot and another represented by two successive dots. The former refers to the directory itself and the latter refers to its parent directory (i.e., the directory that contains it). These items are automatically created in every directory, as can be seen by using the ls command with its -a option (which instructs it to show all of its contents, including hidden items). Thus, for example, the following would show both items, along with everything else, in the current directory (i.e., the directory in which the user is currently working):

ls -a

It is often convenient to use these dot items in commands. For example, a user can change to the parent directory of the current directory by using the cd (i.e., change directory) command with two successive dots as its argument (i.e., input data) as follows:

cd ..

Likewise, a user can easily change to the grandparent of the current directory by using two sets of double dots separated by a forward slash (which is used in this situation as a directory separator) as follows:

cd ../..

The use of the single dot to represent the current directory in commands is less common because the current directory is usually the default directory in commands. An example of its use would be to move a file named file1 into the current directory from the latter's parent directory with the mv command, which would be accomplished as follows:

mv ../file1 .

A dot command consists of the name of an executable program (i.e., a ready-to-run program) preceded by a dot and a forward slash. It is often necessary to use this form to launch user-compiled (i.e., converted from source code to executable form with a compiler) programs, but it is generally not necessary for built-in programs.

When used anywhere else in a file name in a Unix-like operating system, a dot is regarded as just another character and has no effect on the file or how it is treated. However, it is considered good practice to avoid the use of dots in the names of filesystem objects except for the situations discussed above. When it is desired to separate words in a name, the most appropriate character is generally the underscore.

Another use of dots on some operating systems, mainly Microsoft Windows and the Macintosh, and in some programs that operate on them is as an ellipsis. This is a sequence of three dots that indicates that additional information is available. An ellipsis after a menu item or after text accompanying a button indicates that selecting the menu item or clicking the button will display an additional dialog box (i.e., small window) from which the user can choose options or enter data.






Created August 14, 2006.
Copyright © 2006 The Linux Information Project. All Rights Reserved.