logo
📚 其他

INI

INI Cheat Sheet - 快速参考指南,收录常用语法、命令与实践。

📂 分类 · 其他🧭 Markdown 速查🏷️ 2 个标签
#ini#config
向下滚动查看内容
返回全部 Cheat Sheets

Getting Started

Introduction
  • INI is a configuration file with a fixed standard format
  • Base elements are keys or properties
  • Each key consists of a name and a value, separated by an equal sign (=)
  • key name is displayed to the left side of the equals sign
  • Equal sign (=) and semicolon (;) are reserved characters
  • INI configuration method comes from the MS-DOS operating system

Now an informal standard for many configurations, other operating systems may use .conf or .cfg as a suffix

Example
INI
滚动查看更多
; Here are the comments
[owner]
name=John Doe
organization=Acme Products

[database]
; Here are the comments
server=192.0.2.42
port=143
file="acme payroll.dat"

[section.subsection]
foo = bar
Comments

Comment (;)

INI
滚动查看更多
; This is the comment text and will be ignored

Comment (#)

INI
滚动查看更多
# Here is the comment text, ⚠️ Some compilers support it

Comments after a line (;,#) (not standard)

INI
滚动查看更多
var = a ; this is an inline comment
foo = bar # this is another inline comment

Comments must appear alone on lines in some cases

Sections
  • The name appears on a line by itself
  • Names are enclosed in square brackets [ and ]
  • No explicit section end delimiter
  • End at the next section declaration or at the end of the file
  • Section and attribute names are case insensitive
<!--rehype:className=style-round-->
INI
滚动查看更多
[section]
key1 = a
key2 = b

The same as JSON below 👇

JSON
滚动查看更多
{
	"section": {
		"key1": "a",
		"key2": "b"
	}
}
Nesting (supported by some parsers)
INI
滚动查看更多
[section]
domain = cheatsheets.zip
[section.subsection]
foo = bar

The same as JSON below 👇

JSON
滚动查看更多
{
  "section": {
    "domain": "cheatsheets.zip"
    "subsection": {
      "foo": "bar"
    }
  }
}

Nest to previous section (shorthand)

INI
滚动查看更多
[section]
domain = cheatsheets.zip
[.subsection]
foo = bar
Escape character
sequencemeaning
\\\ (single backslash, escape escape character)
\'apostrophe
\"double quotes
\0null character
\aringtone/alert/sound
\bBackspace, [Bell character] for some applications (https://en.wikipedia.org/wiki/Bell_character)
\ttab character
\rcarriage return
\nnewline
\;semicolon
\#number sign
\=equal sign
\:colon
\x????Unicode character for the hexadecimal code point corresponding to ????
Array
INI
滚动查看更多
[section]
domain = cheatsheets.zip
array[]=first value
array[]=second value

The same as JSON below 👇

JSON
滚动查看更多
{
	"section": {
		"domain": "cheatsheets.zip",
		"array": ["first value", "second value"]
	}
}
Interpreter

See also

相关 Cheat Sheets

1v1免费职业咨询
logo

Follow Us

linkedinfacebooktwitterinstagramweiboyoutubebilibilitiktokxigua

We Accept

/image/layout/pay-paypal.png/image/layout/pay-visa.png/image/layout/pay-master-card.png/image/layout/pay-airwallex.png/image/layout/pay-alipay.png

地址

Level 10b, 144 Edward Street, Brisbane CBD(Headquarter)
Level 2, 171 La Trobe St, Melbourne VIC 3000
四川省成都市武侯区桂溪街道天府大道中段500号D5东方希望天祥广场B座45A13号
Business Hub, 155 Waymouth St, Adelaide SA 5000

Disclaimer

footer-disclaimerfooter-disclaimer

JR Academy acknowledges Traditional Owners of Country throughout Australia and recognises the continuing connection to lands, waters and communities. We pay our respect to Aboriginal and Torres Strait Islander cultures; and to Elders past and present. Aboriginal and Torres Strait Islander peoples should be aware that this website may contain images or names of people who have since passed away.

匠人学院网站上的所有内容,包括课程材料、徽标和匠人学院网站上提供的信息,均受澳大利亚政府知识产权法的保护。严禁未经授权使用、销售、分发、复制或修改。违规行为可能会导致法律诉讼。通过访问我们的网站,您同意尊重我们的知识产权。 JR Academy Pty Ltd 保留所有权利,包括专利、商标和版权。任何侵权行为都将受到法律追究。查看用户协议

© 2017-2025 JR Academy Pty Ltd. All rights reserved.

ABN 26621887572