In computing, configuration files (commonly known simply as config files) are files used to configure the parameters and initial settings for some computer programs or applications, server processes and operating system settings.
Some applications provide tools to create, modify, and verify the syntax of their configuration files; these sometimes have graphical interfaces. For other programs, system administrators may be expected to create and modify files by hand using a text editor, which is possible because many are human-editable plain text files. For server processes and operating-system settings, there is often no standard tool, but operating systems may provide their own graphical interfaces such as YaST or debconf.
Some computer programs only read their configuration files at startup. Others periodically check the configuration files for changes. Users can instruct some programs to re-read the configuration files and apply the changes to the current process, or indeed to read arbitrary files as a configuration file. There are no definitive standards or strong conventions.
Across Unix-like operating systems many different configuration-file formats exist, with each application or service potentially having a unique format, but there is a strong tradition of them being in human-editable plain text, and a simple key–value pair format is common. Filename extensions of .cnf
, .conf
, .cfg
, .cf
or .ini
are often used.
Almost all formats allow comments, in which case, individual settings can be disabled by prepending with the comment character. Often the default configuration files contain extensive internal documentation in the form of comments [1] [2] and man files are also typically used to document the format and options available.
System-wide software often uses configuration files stored in /etc
, while user applications often use a "dotfile" – a file or directory in the home directory prefixed with a period, which in Unix hides the file or directory from casual listing. Since this causes pollution, newer user applications generally make their own folder in the .config
directory, a standardized subdirectory of the home directory.
Some configuration files run a set of commands upon startup. A common convention is for such files to have "rc
" in their name, [3] typically using the name of the program then an "(.)rc
" suffix e.g. ".xinitrc
", ".vimrc
", ".bashrc
", "xsane.rc
". See run commands for further details.
By contrast, IBM's AIX uses an Object Data Manager (ODM) database to store much of its system settings.
MS-DOS itself primarily relied on just one configuration file, CONFIG.SYS
. This was a plain text file with simple key–value pairs (e.g. DEVICEHIGH=C:\DOS\ANSI.SYS
) until MS-DOS 6, which introduced an INI-file style format. There was also a standard plain text batch file named AUTOEXEC.BAT
that ran a series of commands on boot. Both these files were retained up to Windows 98SE, which still ran on top of MS-DOS.
An example CONFIG.SYS for MS-DOS 5:
DOS=HIGH,UMBDEVICE=C:\DOS\HIMEM.SYSDEVICE=C:\DOS\EMM386.EXE RAMDEVICEHIGH=C:\DOS\ANSI.SYSFILES=30SHELL=C:\DOS\COMMAND.COM C:\DOS /E:512 /P
DOS applications used a wide variety of individual configuration files, most of them binary, proprietary and undocumented - and there were no common conventions or formats.[ citation needed ]
The early Microsoft Windows family of operating systems heavily utilized plain-text INI files (from "initialization"). These served as the primary mechanism to configure the operating system and application features. [4] The APIs to read and write from these still exist in Windows, but after 1993, Microsoft began to steer developers away from using INI files and toward storing settings in the Windows Registry, a hierarchical database to store configuration settings, which was introduced that year with Windows NT.
The Property List is the standard configuration file format in macOS (as well as in iOS, NeXTSTEP, GNUstep and Cocoa applications). It uses the filename extension .plist
.
IBM's OS/2 uses a binary format, also with a .INI suffix, but this differs from the Windows versions. It contains a list of lists of untyped key–value pairs. [5] Two files control system-wide settings: OS2.INI and OS2SYS.INI. Application developers can choose whether to use them or to create a specific file for their applications.
HarmonyOS and OpenHarmony-based operating systems uses “config.json” configuration file in the root directory of each HAP application. It contains three modules such as app
, deviceConfig
and Module
. The config.json
file adheres to the JSON file format, where each entry comprises an attribute and its corresponding value. The sequence of attribute values is arbitrary, but each attribute must be unique and non-repetitive. The value assigned to each attribute aligns with the fundamental data types of JSON. HarmonyOS’ DevEco Studio provides two methods for editing config.json
: the code editing view and the visual editing view. The `app` object holds the universal configuration details for the application, as demonstrated in the config.json
configuration file of HarmonyOS's foundational application. DeviceConfig
encompasses the configuration details for specific devices, including default, Phone, Tablet, PC, TV, Car, Wearable, liteWearable, and smartVision. The settings under the default label apply to all devices. If there are unique requirements for other devices, the settings under the respective device type label need to be configured. The Module
object carries the HAP package configuration details, the essential attributes that each Ability must define (such as package name, class name, type, and capabilities provided by Ability), along with the permissions the application needs to access the system or other protected sections of the application. The MainAbility
Indicates the name of HAP package’s entrance ability. [6]
A number of general-purpose serialization formats exist that can represent complex data structures in an easily stored format, and these are often used as a basis for configuration files, particularly in open-source and platform-neutral software applications and libraries. The specifications describing these formats are routinely made available to the public, thus increasing the availability of parsers and emitters across programming languages.
Format | Formal specs | Allows comments | Syntax typing [8] [9] |
---|---|---|---|
CUE [10] | Yes | Yes | Yes |
INI | No | Yes | No |
JSON | Yes [11] | No | Yes |
TOML | Yes [12] | Yes | Yes |
UCL | No [13] | Yes | Yes |
YAML | Yes [14] | Yes | Yes |
XML | Yes [15] | Yes | No |
In computer data storage, drive letter assignment is the process of assigning alphabetical identifiers to volumes. Unlike the concept of UNIX mount points, where volumes are named and located arbitrarily in a single hierarchical namespace, drive letter assignment allows multiple highest-level namespaces. Drive letter assignment is thus a process of using letters to name the roots of the "forest" representing the file system; each volume holds an independent "tree".
AmigaDOS is the disk operating system of the AmigaOS, which includes file systems, file and directory manipulation, the command-line interface, and file redirection.
A newline is a control character or sequence of control characters in character encoding specifications such as ASCII, EBCDIC, Unicode, etc. This character, or a sequence of characters, is used to signify the end of a line of text and the start of a new one.
NTLDR is the boot loader for all releases of Windows NT operating system from 1993 with the release of Windows NT 3.1 up until Windows XP and Windows Server 2003. From Windows Vista onwards it was replaced by the BOOTMGR bootloader. NTLDR is typically run from the primary storage device, but it can also run from portable storage devices such as a CD-ROM, USB flash drive, or floppy disk. NTLDR can also load a non NT-based operating system given the appropriate boot sector in a file.
YAML is a human-readable data serialization language. It is commonly used for configuration files and in applications where data is being stored or transmitted. YAML targets many of the same communications applications as Extensible Markup Language (XML) but has a minimal syntax that intentionally differs from Standard Generalized Markup Language (SGML). It uses Python-style indentation to indicate nesting and does not require quotes around most string values.
An environment variable is a user-definable value that can affect the way running processes will behave on a computer. Environment variables are part of the environment in which a process runs. For example, a running process can query the value of the TEMP environment variable to discover a suitable location to store temporary files, or the HOME or USERPROFILE variable to find the directory structure owned by the user running the process.
A path is a string of characters used to uniquely identify a location in a directory structure. It is composed by following the directory tree hierarchy in which components, separated by a delimiting character, represent each directory. The delimiting character is most commonly the slash ("/"), the backslash character ("\"), or colon (":"), though some operating systems may use a different delimiter. Paths are used extensively in computer science to represent the directory/file relationships common in modern operating systems and are essential in the construction of Uniform Resource Locators (URLs). Resources can be represented by either absolute or relative paths.
Windows 9x is a generic term referring to a line of discontinued Microsoft Windows operating systems from 1995 to 2000, which were based on the Windows 95 kernel and its underlying foundation of MS-DOS, both of which were updated in subsequent versions. The first version in the 9x series was Windows 95, which was succeeded by Windows 98 and then Windows Me, which was the third and last version of Windows on the 9x line, until the series was superseded by Windows XP.
CONFIG.SYS is the primary configuration file for the DOS and OS/2 operating systems. It is a special ASCII text file that contains user-accessible setup or configuration directives evaluated by the operating system's DOS BIOS during boot. CONFIG.SYS was introduced with DOS 2.0.
AUTOEXEC.BAT
is a system file that was originally on DOS-type operating systems. It is a plain-text batch file in the root directory of the boot device. The name of the file is an abbreviation of "automatic execution", which describes its function in automatically executing commands on system startup; the filename was coined in response to the 8.3 filename limitations of the FAT file system family.
The Windows Registry is a hierarchical database that stores low-level settings for the Microsoft Windows operating system and for applications that opt to use the registry. The kernel, device drivers, services, Security Accounts Manager, and user interfaces can all use the registry. The registry also allows access to counters for profiling system performance.
JSON is an open standard file format and data interchange format that uses human-readable text to store and transmit data objects consisting of name–value pairs and arrays. It is a commonly used data format with diverse uses in electronic data interchange, including that of web applications with servers.
An INI file is a configuration file for computer software that consists of plain text with a structure and syntax comprising key–value pairs organized in sections. The name of these configuration files comes from the filename extension INI, short for initialization, used in the MS-DOS operating system which popularized this method of software configuration. The format has become an informal standard in many contexts of configuration, but many applications on other operating systems use different file name extensions, such as conf and cfg.
.sys is a filename extension used in MS-DOS applications and Microsoft Windows operating systems. They are system files that contain device drivers or hardware configurations for the system.
SpartaDOS X is a disk operating system for the Atari 8-bit computers that closely resembles MS-DOS. It was developed and sold by ICD in 1987-1993, and many years later picked up by the third-party community SpartaDOS X Upgrade Project, which still maintains the software.
DOS is a family of disk-based operating systems for IBM PC compatible computers. The DOS family primarily consists of IBM PC DOS and a rebranded version, Microsoft's MS-DOS, both of which were introduced in 1981. Later compatible systems from other manufacturers include DR-DOS (1988), ROM-DOS (1989), PTS-DOS (1993), and FreeDOS (1998). MS-DOS dominated the IBM PC compatible market between 1981 and 1995.
The Windows 9x series of operating systems refers to a series of Microsoft Windows operating systems produced from 1995 to 2000. They are based on the Windows 95 kernel which is a monolithic kernel. The basic code is similar in function to MS-DOS. They are 16-/32-bit hybrids and require support from MS-DOS to operate.
A command-line interface (CLI) is a means of interacting with a computer program by inputting lines of text called command-lines. Command-line interfaces emerged in the mid-1960s, on computer terminals, as an interactive and more user-friendly alternative to the non-interactive interface available with punched cards.
Static site generators (SSGs) are software engines that use text input files to generate static web pages. Static sites generated by static site generators do not require a backend after site generation, making them first-class citizens on content delivery networks (CDNs). Some of the most popular static site generators are Jekyll, Hugo, Eleventy, Gatsby, and Next js, SSGs are typically for rarely-changing, informative content, such as product pages, news articles, software documentation, and blogs.
Tom's Obvious, Minimal Language is a file format for configuration files. It is intended to be easy to read and write due to obvious semantics which aim to be "minimal", and it is designed to map unambiguously to a dictionary. Originally created by Tom Preston-Werner, its specification is open source. TOML is used in a number of software projects and is implemented in many programming languages.
true
will be a Boolean while "true"
will be a string – whereas in languages that do not allow syntax typing it will be semantics-based – e.g. true
and "true"
will be both recognizable as Booleans, while microwave
and "microwave"
will be both recognizable as strings (this will require the parser to have some prior expectations about the type of a particular field, but this is often the case in configuration files).