A filename is a special kind of string used to uniquely identify a file stored on the file system of a computer. Depending on the operating system, such a name may also identify a directory. Different operating systems impose different restrictions regarding length and allowed characters on filenames. A filename includes one or more of these components:
In order to refer to a file on a remote computer (aka: host, server) the remote computer must be known. The remote computer name or address might part of the file name, or it might be specified at the time a file system is "mounted", in which case it won't necessarily be part of the file name.
In some systems, if a filename does not contain a path part, the file is assumed to be in the current working directory.
Many operating systems, including MS-DOS, Microsoft Windows, and VMS systems, allow a filename extension that consists of one or more characters following the last period in the filename, thus dividing the filename into two parts: the basename (the primary filename) and the extension (usually indicating the file type associated with a certain file format). On these systems the extension is considered part of the filename, and on systems which allow (for example) an eight character basename followed by a three character extension, a filename with an extension of "" or " " (nothing, or three spaces) will still be 11 characters long (since the "." is supplied by, but not considered as part of the name by, the OS). On Unix-like systems, files will often have an extension (for example prog.c, denoting the C-language source code of a program called "prog"); but since the extension is not considered a separate part of the filename, a file on a Unix system which allows 14-character filenames, and with a filename which uses "." as an "extension separator" or "delimiter", could possibly have a filename such as a.longxtension
Within a single directory, filenames must be unique. However, two files in different directories may have the same name. On Unix, however, upper-case and lower-case are considered different, so that files MyName and myname would be valid names for different files in the directory; historically, names with upper-case characters in them have come before those with all-lower-case names in them in directory (folder) listings; many Unix software vendors use this scheme to make important files, such as INSTALL or README, appear in listings before relatively less important files or directories (like lib).
Unix-like systems allow a file to have more than one name; in traditional Unix-style file systems, the names are hard links to the file's inode or equivalent. Hard links are different from Windows shortcuts, Mac OS aliases, or symbolic links.