Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Configuration file
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
{{Short description|File holding settings for a computer program}} {{Redirect|rc file|resource scripts|Resource (Windows)}} A '''configuration file''', a.k.a. '''config file''', is a [[computer file|file]] that stores [[computer data|data]] used to configure a [[software system]] such as an [[application software|application]], a [[server (computing)|server]] or an [[operating system]]. Some applications provide a tool to create, modify, and verify the [[syntax]] of their configuration files {{endash}} sometimes via [[graphical user interface]] (GUI). For context, [[system administrator]]s may be expected to create and modify [[plain text|text]] config files via a text editor. For server processes and operating-system settings, there is often no standard tool, but operating systems may provide graphical interfaces such as [[YaST]] or debconf. Some computer programs only read their configuration files at [[Booting|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. [[File:Gnu grub config file.png|400px|thumb|A configuration file for [[GNU GRUB]].]] ==File format== In general, a config file can have any [[File format|format]]. The format that applies to a particular system is determined by the design of that system. Often, a standardized format is used since it allows for using tools designed for the format even if not designed for the consuming system. In particular, general-purpose [[serialization]] formats, such as [[JSON]], [[XML]], and [[YAML]], are often used in [[Open-source software|open-source]] and [[Cross-platform|platform-neutral]] software. The [[specification]] for these formats are generally publicly available to support wide-spread use. The following table compares notable formats used for configuration data. {| class="wikitable" |+Format comparison<ref>{{Citation |title=TOML |date=2023-01-15 |url=https://github.com/toml-lang/toml |publisher=TOML |access-date=2023-01-15}}</ref> ! scope="col" |Format ! scope="col" |Formal<br>spec ! scope="col" |Allows<br>[[Comment (computer programming)|comments]] ! scope="col" |Syntax<br>typing |- |CUE<ref>{{cite web |title=About {{!}} CUE |url=https://cuelang.org/docs/about/ |access-date=October 6, 2022}}</ref>|| {{Yes}} || {{Yes}} || {{good|Yes}} |- |[[INI file|INI]]|| {{No}} || {{Yes}} || {{good|No}} |- |[[JSON]]|| {{Yes}}<ref>{{Cite web|url=https://datatracker.ietf.org/doc/html/rfc8259|title=The JavaScript Object Notation (JSON) Data Interchange Format}}</ref> || {{No}} || {{good|Yes}} |- |[[TOML]]|| {{Yes}}<ref>{{Cite web|url=https://toml.io/en/v1.0.0|title=TOML Specification}}</ref> || {{Yes}} || {{good|Yes}} |- |[https://github.com/vstakhov/libucl UCL]|| {{No}}<ref>{{cite web |title=Formal UCL grammar definition · Issue #231 · vstakhov/libucl |url=https://github.com/vstakhov/libucl/issues/231 |website=GitHub |language=en}}</ref> || {{Yes}} || {{good|Yes}} |- |[[YAML]]|| {{Yes}}<ref>{{Cite web|url=https://yaml.org/spec|title=YAML™ Specification Index}}</ref> || {{Yes}} || {{good|Yes}} |- |[[XML]]|| {{Yes}}<ref>{{Cite web|url=https://www.w3.org/TR/xml/|title=Extensible Markup Language (XML) 1.0 (Fifth Edition)}}</ref> || {{Yes}} || {{good|No}} |} The ''syntax typing'' column indicates whether the [[Syntax (programming languages)|syntax]] supports [[data type]]s. A format has syntax-typing if a value's type is specified by syntax – e.g. <code>true</code> is a [[Boolean data type|Boolean]] while <code>"true"</code> is a [[String (computer science)|string]]. A format does not have syntax-typing if a value's type is based on [[Semantics (computer science)|semantics]] – e.g. <code>true</code> and <code>"true"</code> are both Boolean if the parser expects a Boolean. Opinions on the value of syntax-typing [https://hitchdev.com/strictyaml/why-not/toml/#4-syntax-typing vary]. ==Examples== The following are examples of config files organized by the [[operating system]]s on which they are commonly used. ===Unix and Unix-like=== Many different file formats are used on [[Unix]] and [[Unix-like]] operating systems. Even so, there is a strong tradition of using human-editable, plain text formats including simple [[key–value pair]]. Filename extensions of <code>.cnf</code>, <code>.conf</code>, <code>.cfg</code>, <code>.cf</code> or <code>.ini</code> are often used. Many formats allow [[Comment (computer programming)|comments]], in which case, individual settings can be disabled by [[comment out|prepending with the comment character]]. Often the default configuration files contain extensive internal documentation in the form of comments<ref name=":0">https://opensource.apple.com/source/postfix/postfix-174.2/Postfix.Config/main.cf.default. {{Webarchive|url=https://web.archive.org/web/20170803053000/https://opensource.apple.com/source/postfix/postfix-174.2/Postfix.Config/main.cf.default |date=2017-08-03 }}</ref><ref name=":1">http://opensource.apple.com/source/apache/apache-769/httpd.conf. {{Webarchive|url=https://web.archive.org/web/20200801023500/https://opensource.apple.com/source/apache/apache-769/httpd.conf |date=2020-08-01 }}</ref> and [[man file]]s are also typically used to document the format and options available. System-wide software often uses configuration files stored in <code>[[/etc]]</code>, while user applications often use a "[[dotfile]]" – a file or directory in the home directory prefixed with a [[full stop|period]], which [[Hidden file and hidden directory#Unix and Unix-like environments|in Unix hides the file or directory]] from casual listing. Since this causes pollution, newer user applications generally make their own folder in the <code>.config</code> directory, a standardized subdirectory of the home directory. Similar to config files, a [[RUNCOM|run command]] (rc) [[shell script]] can configure a [[shell (computing)|shell]] session. Often, such scripts are named with an <code>rc</code> suffix after the consuming program's name such as <code>.xinitrc</code>, <code>.vimrc</code>, <code>.bashrc</code>, <code>xsane.rc</code>.<ref name="autogenerated1">{{cite web|url=http://www.catb.org/jargon/html/R/rc-file.html |title=rc file |publisher=Catb.org |access-date=2012-02-29}}</ref> By contrast, [[IBM]]'s [[AIX]] uses an [[Object Data Manager]] (ODM) database to store much of its system settings. ===MS-DOS=== [[MS-DOS]] primarily relied on the <code>[[CONFIG.SYS]]</code> config file; a plain text file with simple key–value pairs (e.g. <code>DEVICEHIGH=C:\DOS\ANSI.SYS</code>). MS-DOS 6 introduced the INI-file format. Similar to an rc file, the [[batch file]] named <code>[[AUTOEXEC.BAT]]</code> ran commands on [[Booting|startup]]. Both these files were retained up to [[Windows 98SE]], which still ran on top of MS-DOS. An example CONFIG.SYS: <syntaxhighlight lang="ini"> 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 </syntaxhighlight> 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|date=October 2016}} ===Windows=== [[File:Regedit (Wine).png|thumb|right|The REGEDIT application being used to edit Windows Registry data]] Early [[Windows]] operating systems heavily utilized plain-text [[INI file]]s which served as the primary mechanism to configure the operating system and applications.<ref>[https://www.microsoft.com/resources/documentation/windowsnt/4/workstation/reskit/en-us/26_ini.mspx Microsoft: Windows NT Workstation Resource Kit].</ref> The [[API]]s 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|registry]], a hierarchical database to store configuration settings, which was introduced with [[Windows NT]]. Later systems use XML and other formats instead of the registry. ===macOS=== The [[Property List]] is the standard configuration file format in [[macOS]] (as well as in [[iOS]], [[NeXTSTEP]], [[GNUstep]] and [[Cocoa (API)|Cocoa]] applications). It uses the [[filename extension]] <code>.plist</code>. ===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 (data structure)|list]] of lists of untyped key–value pairs.<ref name="voice">''[http://www.os2voice.org/VNL/past_issues/VNL0904H/vnewsf4.htm The OS/2 INI Files]'' by James J. Weinkam.</ref> 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 operating systems === [[HarmonyOS]] and [[OpenHarmony]]-based operating systems use JSON config files, named {{code|config.json}}. The platform [[integrated development environment|IDE]], [[DevEco Studio]], provides methods for editing <code>config.json</code>.<ref>{{cite web |last1=Evans |first1=Melissa |title=HarmonyOS (Hongmeng) — config.json |url=https://www.mo4tech.com/harmonyos-hongmeng-config-json.html |website=Mo4Tech |publisher=Mo4Tech |access-date=24 March 2024}}</ref> ==See also== * [[.properties]], file extension for config file mainly used in [[Java (programming language)|Java]] * [[HOCON]], a superset of .properties and JSON * [[Run commands]], historical origin of the "rc" suffix for startup scripts ==References== <references /> {{DEFAULTSORT:Configuration File}} <!--[[Category:Computer data]] deleted. That cat is about data in general, not some particular application's data --> [[Category:Configuration files| ]]
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)
Pages transcluded onto the current version of this page
(
help
)
:
Template:Citation
(
edit
)
Template:Citation needed
(
edit
)
Template:Cite web
(
edit
)
Template:Code
(
edit
)
Template:Endash
(
edit
)
Template:Good
(
edit
)
Template:No
(
edit
)
Template:Redirect
(
edit
)
Template:Short description
(
edit
)
Template:Webarchive
(
edit
)
Template:Yes
(
edit
)