In
computing, configuration files (commonly known simply as config files) are
files used to configure the
parameters and
initial settings for some
computer programs. They are used for user
applications,
server processes and
operating system settings.
Some applications provide tools to create, modify, and verify the
syntax
In linguistics, syntax () is the study of how words and morphemes combine to form larger units such as phrases and sentences. Central concerns of syntax include word order, grammatical relations, hierarchical sentence structure ( constituency) ...
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
A startup or start-up is a company or project undertaken by an entrepreneur to seek, develop, and validate a scalable business model. While entrepreneurship refers to all new businesses, including self-employment and businesses that never intend t ...
. 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.
Configuration files and operating systems
Unix and Unix-like operating systems
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
Comment may refer to:
* Comment (linguistics) or rheme, that which is said about the topic (theme) of a sentence
* Bernard Comment (born 1960), Swiss writer and publisher
Computing
* Comment (computer programming), explanatory text or informa ...
, 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
[https://opensource.apple.com/source/postfix/postfix-174.2/Postfix.Config/main.cf.default. ][http://opensource.apple.com/source/apache/apache-769/httpd.conf. ] and
man files are also typically used to document the format and options available.
System-wide software often uses configuration files stored in
/etc
In Unix and operating systems inspired by it, the file system is considered a central component of the operating system. It was also one of the first parts of the system to be designed and implemented by Ken Thompson in the first experimental ...
, while user applications often use a "
dotfile
In computing, a hidden folder (sometimes hidden directory) or hidden file is a folder (computing), folder or computer file, file which filesystem utilities do not display by default when showing a Directory (computing), directory listing. They ar ...
" – a file or directory in the home directory prefixed with a
period, which
in Unix hides the file or directory from casual listing.
Some configuration files run a set of commands upon startup. A common convention is for such files to have "
rc
" in their name,
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
MS-DOS itself primarily relied on just one configuration file,
CONFIG.SYS
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 (typically residing ...
. 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
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 funct ...
that ran a series of commands on
boot
A boot is a type of footwear. Most boots mainly cover the foot and the ankle, while some also cover some part of the lower calf. Some boots extend up the leg, sometimes as far as the knee or even the hip. Most boots have a heel that is cle ...
. 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,UMB
DEVICE=C:\DOS\HIMEM.SYS
DEVICE=C:\DOS\EMM386.EXE RAM
DEVICEHIGH=C:\DOS\ANSI.SYS
FILES=30
SHELL=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.
Microsoft Windows

The early
Microsoft Windows
Windows is a group of several proprietary graphical operating system families developed and marketed by Microsoft. Each family caters to a certain sector of the computing industry. For example, Windows NT for consumers, Windows Server for serv ...
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.
Microsoft: Windows NT Workstation Resource Kit
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.
macOS
The Property List is the standard configuration file format in macOS (as well as in iOS, NeXTSTEP, GNUstep and Cocoa
Cocoa may refer to:
Chocolate
* Chocolate
* ''Theobroma cacao'', the cocoa tree
* Cocoa bean, seed of ''Theobroma cacao''
* Chocolate liquor, or cocoa liquor, pure, liquid chocolate extracted from the cocoa bean, including both cocoa butter and ...
applications). It uses the filename extension .plist
.
IBM OS/2
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.
The OS/2 INI Files
' by James J. Weinkam.
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.
Serialization formats
A number of general-purpose serialization
In computing, serialization (or serialisation) is the process of translating a data structure or object state into a format that can be stored (e.g. files in secondary storage devices, data buffers in primary storage devices) or transmitted (e ...
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
Open source is source code that is made freely available for possible modification and redistribution. Products include permission to use the source code, design documents, or content of the product. The open-source model is a decentralized sof ...
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.
Examples include: JSON
JSON (JavaScript Object Notation, pronounced ; also ) is an open standard file format and data interchange format that uses human-readable text to store and transmit data objects consisting of attribute–value pairs and arrays (or other ser ...
, XML, and YAML.
See also
* .properties
.properties is a file extension for files mainly used in Java-related technologies to store the configurable parameters of an application. They can also be used for storing strings for Internationalization and localization; these are known as P ...
, a file extension mainly used in Java
* HOCON, a superset of .properties and JSON
* INI file, a common configuration file format
* JSON
JSON (JavaScript Object Notation, pronounced ; also ) is an open standard file format and data interchange format that uses human-readable text to store and transmit data objects consisting of attribute–value pairs and arrays (or other ser ...
, with support for complex data types and data structures
* Run commands, which explains the historical origin of the "rc" suffix
* TOML, a formally-specified configuration file format
* YAML, with support for complex data types and structures
References
{{DEFAULTSORT:Configuration File