LINFO

Tilde Definition



A tilde (pronounced TILL-duh) is a short, curvy horizontal line character that is located on the upper left on most keyboards, usually on the same key as the backquote. It has a number of uses, including several with regard to computers.

The tilde was originally a small letter n that served as a form of contraction in documents written in the Latin language. An n or m following a vowel was often omitted and, instead, a tilde was placed over the vowel. The name of the character comes from Spanish, which, in turn, is derived from the Latin word titulus meaning a title or superscription.

Today the tilde is placed over the letter n (i.e., ñ) in Spanish to indicate a palatal nasal sound (a sound which is fairly common in European languages), and this combination of the tilde and the letter n is treated as a distinct letter of the alphabet. The tilde is also used to indicate nasalization in Portuguese, but it is used over the vowels a and o instead of over n. It is additionally found in several other languages that are written with the Roman alphabet, including Estonian, Navaho and Vietnamese.

In the English language, the tilde is often used to mean approximately. In logic, it represents negation. In electronics, it is used to approximate the sine wave symbol, which, in turn, is used to indicate alternating current. The tilde is also sometimes used instead of a hyphen or dash between two numbers to indicate that they are a range or a part number or model number.

The first use of the tilde as a distinct character in English may have occurred in the early 1960s. And it appears that IBM was the first to use it for computer applications. The tilde was not included in the original version of ASCII (the de facto standard for the character encoding used by computers and communications equipment to represent text), which was published in 1963, but it was added in 1965 as part of a revised version (ASCII-1965) along with the angular circumflex ( ^ ), the underscore ( _ ) and the at ( @ ) characters.

One of the best known uses of the tilde in computer applications is the file naming system in Microsoft's original FAT (file allocation table) filesystem. File names are limited to eight characters plus a three-character extension (referred to as the 8.3 format). Files with longer names are automatically renamed by following the first six original characters with a tilde to represent the omitted characters and then adding a single digit. FAT also converts all lower case letters to upper case letters. Thus, for example, a file named Microsoft.txt would be renamed MICROS~1.TXT.

A user's home directory on Unix-like operating systems traditionally has been represented by a tilde. A home directory, also called a login directory, is the directory that serves as the repository for a user's personal files, directories and programs, and it is the directory a user is first in after logging into the system.

Thus, if a user wants to change its current directory (i.e., the directory in which it is currently working) from any location on the system to its home directory, it can do so by using the cd (i.e., change directory) command with a tilde as an argument (i.e., input), i.e.,

cd ~

This is the origin of the practice of using tildes in URLs (uniform resource locators) to denote individual web sites on a single domain name (i.e., the registered unique name of a web site). For example, the tilde in the URL http://www.connectexpress.com/~ips/lady/ means that the directory ips is an individual account on the website-hosting server that has a domain name of connectexpress.com.

There is some controversy as to whether tildes should be used in URLs. One lengthy treatise explaining why it should not be used in URLs, however, actually contains a tilde in its own URL1.

In early 1987, the less command (a pager which allows text to be read one screenful at a time) began using the tilde to denote lines after the end of a file. The vi text editor likewise displays a tilde at the beginning of each line on the screen that is beyond the end of the file. Some other text editors, including gedit and Emacs, form the names used for backup files by appending a tilde to the end of the original file name.

Tildes are also used as part of the pattern matching operators for the regular expressions (a powerful text search mechanism) that were first used in the Perl programming language and which are now widely employed by other languages and by various programs.

________
1 Why tilde (~) should not be used in Web addresses (URLs) http://www.cs.tut.fi/~jkorpela/tilde.html






Created June 24, 2005.
Copyright © 2005 The Linux Information Project. All Rights Reserved.